Atomikos Forum |
|
Hi,
I'm having a serious problem with loading several J2SE modules of mine which all start their own Atomikos TM. I'm seeing several problems, one of which I saw a discussion about in MSDN. http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/15c1e6f5-ec1e-4376-8f45-25e61ffc1306 It seems that the problem is that there is a need to supply a "serverid" property to each TM so that MS-SQL can work against each TM. This property exists in Bitronix and solved the issue for several of their users who were experiencing the issue but I was unable to find a parallel property in Atomikos. Is there such a property and I'm not aware of it? Is it a bug of Atomikos? Is there a different workarround? Thanks, Ittai
Hi Guy,
It did solve the problem but unfortunately I'm still seeing another problem in Atomikos logs which is a SQLServerException. I see this in the logs: 10-11-30 09:16:05,275 [main] a SessionHandleState with 1 context(s): checking XA context for transaction com.atomikos.icatch.imp.CompositeTransactionImp@635d2874 10-11-30 09:16:05,291 [main] Coordinator 192.168.0.198.tm0000100001 entering state: ACTIVE 10-11-30 09:16:05,291 [main] Coordinator 192.168.0.198.tm0000100001 entered state: ACTIVE 10-11-30 09:16:05,291 [main] addParticipant ( XAResourceTransaction: 3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31 ) for transaction 192.168.0.198.tm0000100001 10-11-30 09:16:05,291 [main] XAResourceTransaction: 3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31: about to switch to XAResource XAResourceID:1 10-11-30 09:16:05,291 [main] XAResourceTransaction 192.168.0.198.tm0000100001192.168.0.198.tm1: switched to XAResource XAResourceID:1 10-11-30 09:16:05,291 [main] XAResource.start ( 3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31 , XAResource.TMNOFLAGS ) on resource java:comp/env/jdbc/dataSource represented by XAResource instance XAResourceID:1 10-11-30 09:16:07,728 [main] XA resource 'java:comp/env/jdbc/dataSource': resume for XID '3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31' raised -3: the XA resource detected an internal error javax.transaction.xa.XAException: Function START: failed, status: -3. The error message is: *** SQLJDBC_XA DTC_ERROR Context: FInitializeTransactionManager, state=1, StatusCode:-3 (0xFFFFFFFD) ***. at com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_Interface(SQLServerXAResource.java:543) at com.microsoft.sqlserver.jdbc.SQLServerXAResource.start(SQLServerXAResource.java:672) at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:476) at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:57) at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:66) at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:85) at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:176) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:197) at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:131) at $Proxy11.prepareStatement(Unknown Source) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2228) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) at org.hibernate.loader.Loader.list(Loader.java:2120) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at com.myCompany.dal.hibernate.BaseHibernateDAO.findByProperty(BaseHibernateDAO.java:94) at com.myCompany.dal.DAO.ConfigurationDAO.findByServer(ConfigurationDAO.java:33) at com.myCompany.common.Config.LoadDBConfiuration(Config.java:70) at com.myCompany.common.Config.init(Config.java:56) at com.myCompany.myModule.myModule.main(myModule.java:52) 10-11-30 09:16:07,744 [main] Error enlisting in transaction - connection might be broken? Please check the logs for more information... com.atomikos.datasource.ResourceException: XA resource 'java:comp/env/jdbc/dataSource': resume for XID '3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31' raised -3: the XA resource detected an internal error at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:483) at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:57) at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:66) at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:85) at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:176) at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:197) at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:131) at $Proxy11.prepareStatement(Unknown Source) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2228) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) at org.hibernate.loader.Loader.list(Loader.java:2120) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at com.myCompany.dal.hibernate.BaseHibernateDAO.findByProperty(BaseHibernateDAO.java:94) at com.myCompany.dal.DAO.ConfigurationDAO.findByServer(ConfigurationDAO.java:33) at com.myCompany.common.Config.LoadDBConfiuration(Config.java:70) at com.myCompany.common.Config.init(Config.java:56) at com.myCompany.myModule.myModule.main(myModule.java:52) 10-11-30 09:16:07,744 [main] getCompositeTransaction() returning instance with id 192.168.0.198.tm0000100001 10-11-30 09:16:07,744 [main] getCompositeTransaction() returning instance with id 192.168.0.198.tm0000100001 10-11-30 09:16:07,806 [main] getCompositeTransaction() returning instance with id 192.168.0.198.tm0000100001 10-11-30 09:16:07,806 [main] getCompositeTransaction() returning instance with id 192.168.0.198.tm0000100001 10-11-30 09:16:07,822 [main] commit() done (by application) of transaction 192.168.0.198.tm0000100001 10-11-30 09:16:07,822 [main] Coordinator 192.168.0.198.tm0000100001 entering state: PREPARING 10-11-30 09:16:07,822 [main] Coordinator 192.168.0.198.tm0000100001 entered state: PREPARING 10-11-30 09:16:07,822 [main] (1.5) executing task: com.atomikos.icatch.imp.Propagator$PropagatorThread@602b6b 10-11-30 09:16:07,822 [main] ThreadFactory: creating new thread: Atomikos:2 10-11-30 09:16:07,822 [main] (1.5) executing task: com.atomikos.icatch.imp.Propagator$PropagatorThread@3e1bc8 10-11-30 09:16:07,822 [main] ThreadFactory: creating new thread: Atomikos:3 10-11-30 09:16:07,822 [Atomikos:3] XAResource.end ( 3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31 , XAResource.TMSUCCESS ) on resource java:comp/env/jdbc/dataSource represented by XAResource instance XAResourceID:1 10-11-30 09:16:09,900 [Atomikos:3] XA resource 'java:comp/env/jdbc/dataSource': end for XID '3139322E3136382E302E3139382E746D30303030313030303031:3139322E3136382E302E3139382E746D31' raised -7: the XA resource has become unavailable javax.transaction.xa.XAException: Function END: failed, status: -7. The error message is: *** SQLJDBC_XA DTC_ERROR Context: xa_end, state=1, StatusCode:-7 (0xFFFFFFF9) ***. at com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_Interface(SQLServerXAResource.java:543) at com.microsoft.sqlserver.jdbc.SQLServerXAResource.end(SQLServerXAResource.java:685) at com.atomikos.datasource.xa.XAResourceTransaction.suspend(XAResourceTransaction.java:440) at com.atomikos.datasource.xa.XAResourceTransaction.prepare(XAResourceTransaction.java:591) at com.atomikos.icatch.imp.PrepareMessage.send(PrepareMessage.java:61) at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:111) at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 10-11-30 09:16:09,900 [main] Coordinator 192.168.0.198.tm0000100001 entering state: ABORTING 10-11-30 09:16:09,900 [main] Coordinator 192.168.0.198.tm0000100001 entered state: ABORTING 10-11-30 09:16:09,900 [main] (1.5) executing task: com.atomikos.icatch.imp.Propagator$PropagatorThread@13b9fae 10-11-30 09:16:09,900 [main] Coordinator 192.168.0.198.tm0000100001 entering state: TERMINATED 10-11-30 09:16:09,900 [main] Coordinator 192.168.0.198.tm0000100001 : stopping timer... 10-11-30 09:16:09,900 [main] Coordinator 192.168.0.198.tm0000100001 : disposing statehandler TERMINATED... 10-11-30 09:16:09,900 [main] Coordinator 192.168.0.198.tm0000100001 : disposed. Have you encountered such a problem? The problem seems to temporarily go away when I restart the MSSQL service but it returns soon after. Thanks in advance, Ittai |