1 Reply Latest reply: Sep 8, 2010 10:00 AM by Mark Little RSS

Exception: Trying to start a new tx when old is not complete

raj jha Newbie

Am using hibernate for inserting some records to a table in an Oracle 10g DB from a spring based application. THe application is deployed on JBOSS 4.2.2 which has 2 data sources defined for 2 different schemas (using local-tx-datasource)but the same DB server. Normally it works fine but after few months of running without any server restart, suddenly hibernate starts throwing following exception (for 5-6 transactions out of 1000 per day);

 

org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)

..........

..........

Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: af05b1e:8bfd:4bc7a077:3a32c status: ActionStatus.ABORT_ONLY >)
at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
... 141 more
Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: af05b1e:8bfd:4bc7a077:3a32c status: ActionStatus.ABORT_ONLY >
at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:744)
at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:577)
at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
... 145 more

 

Server std out log shows following


2010-07-12 22:18:51,253 http-sbkcomappp10%2F10.240.91.30-8543-4 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.enliststarterror] [com.arjuna.ats.internal.jta.transaction.arjunacore.enliststarterror] TransactionImple.enlistResource - XAResource.start returned: XAException.XAER_PROTO for < 131075, 29, 27, 1-af05b1e:8bfd:4bc7a077:3a32caf05b1e:8bfd:4bc7a077:3a32e>
2010-07-12 22:18:51,253 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR] org.jboss.resource.connectionmanager.JBossLocalXAException: Trying to start a new tx when old is not complete! old: < 131075, 29, 27, 1-af05b1e:8bfd:4bc7a077:3a190af05b1e:8bfd:4bc7a077:3a193>, new < 131075, 29, 27, 1-af05b1e:8bfd:4bc7a077:3a32caf05b1e:8bfd:4bc7a077:3a32e>, flags 0
2010-07-12 22:18:51,254 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.start(TxConnectionManager.java:886)
2010-07-12 22:18:51,254 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:776)
2010-07-12 22:18:51,254 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:499)
2010-07-12 22:18:51,254 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:773)
2010-07-12 22:18:51,254 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:564)
2010-07-12 22:18:51,254 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
2010-07-12 22:18:51,255 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
2010-07-12 22:18:51,255 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
2010-07-12 22:18:51,255 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
2010-07-12 22:18:51,255 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
2010-07-12 22:18:51,255 http-sbkcomappp10%2F10.240.91.30-8543-4 ERROR [STDERR]  at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)

.............

 

Please suggest. I dont see any issue of connection pool getting exhausted as the health monitor (which gets triggerred when above issue occurs) running in the same server is able to pass the test for DB connection.

 

Thanks in advance.