Frequently getting "error enlisting a JdbcConnectionHandle..."

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
This post has NOT been accepted by the mailing list yet.
Hello,

I am using bitronix transaction manager (btm-2.1.3.jar).

I frequently get:

Caused by: java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/JAYANTDB in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on com.mysql.jdbc.JDBC4Connection@1f20d10d on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state STARTED
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:87)
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:242)
        at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64)
        at $Proxy55.prepareStatement(Unknown Source)
        ... 12 more
Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed out
        at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:85)
        ... 19 more


I am using following properties:

resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds2.uniqueName=jdbc/JAYANTDB
resource.ds2.minPoolSize=300
resource.ds2.maxPoolSize=400
resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/jayantdb?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
resource.ds2.driverProperties.user=root
resource.ds2.driverProperties.password=root
resource.ds2.allowLocalTransactions=true
resource.ds2.testQuery=SELECT current_timestamp


Using mysql-5.5 having 1000 max-connections.


What can be the cause of this problem?

Thanks in advance.
Jayant
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
This post has NOT been accepted by the mailing list yet.
Can anyone please update me on this.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

rramchandhar
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi All,

We have a similar issue, where camel was reading messages from the queues and the issue occured only on a single queue suprisingly. we restarted the server and everything worked fine.our application is a mission critical application. would someone help resolve this issue. below are the ocnfigurations on production servers.

Database : oracle 11g.
no weblogic/ or any other container. we have built our own platform.
===========================================================================

Number of minPoolSize: 3 and max =10.

private PoolingDataSource createPoolingDataSource(final DataSourceConfig dataSourceConfig)
    {
        poolingDataSource = new PoolingDataSource();
        poolingDataSource.setClassName(bitronix.tm.resource.jdbc.lrc.LrcXADataSource.class.getName());
        poolingDataSource.setUniqueName(getDatasourceName());
        poolingDataSource.setMinPoolSize(dataSourceConfig.getMinPoolSize());
        poolingDataSource.setMaxPoolSize(dataSourceConfig.getMaxPoolSize());
        poolingDataSource.setAllowLocalTransactions(true);
        poolingDataSource.setApplyTransactionTimeout(true);
        poolingDataSource.setEnableJdbc4ConnectionTest(true);

        poolingDataSource.setDriverProperties(new Properties()
        {{
                setProperty("url", dataSourceConfig.getUrl());
                setProperty("user", dataSourceConfig.getUser());
                setProperty("password", dataSourceConfig.getPassword());
                setProperty("driverClassName", OracleDriver.class.getName());
            }});

        poolingDataSource.init();

        return poolingDataSource;
    }

===========================================================================

Caused by
exception.message org.hibernate.exception.GenericJDBCException: could not prepare statement
exception.class com.bt.ewmp.workFlow.thirdPartyTasking.exceptions.UnrecoverableException
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CapabilityBase.processMessage(CapabilityBase.java:84)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor$1.doInTransactionWithoutResult(CamelCapabilityProcessor.java:100)
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.executeCapabilityInANewTransaction(CamelCapabilityProcessor.java:92)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.process(CamelCapabilityProcessor.java:60)
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:244)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
Caused by
exception.message could not prepare statement
exception.class org.hibernate.exception.GenericJDBCException
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:188)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1858)
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1835)
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1815)
org.hibernate.loader.Loader.doQuery(Loader.java:899)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:311)
org.hibernate.loader.Loader.loadCollection(Loader.java:2234)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1849)
org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549)
org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234)
org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
org.hibernate.collection.internal.AbstractPersistentCollection.write(AbstractPersistentCollection.java:370)
org.hibernate.collection.internal.PersistentBag.add(PersistentBag.java:291)
com.bt.ewmp.workFlow.thirdPartyTasking.allocations.PeriodAllocationsGroup.recordFailure(PeriodAllocationsGroup.java:218)
com.bt.ewmp.workFlow.thirdPartyTasking.tasks.eas.JobClosureAtEasTask.recordFailuresAndPersistPeriodAllocationsGroups(JobClosureAtEasTask.java:54)
com.bt.ewmp.workFlow.thirdPartyTasking.tasks.eas.JobClosureAtEasTask.execute(JobClosureAtEasTask.java:42)
com.bt.ewmp.workFlow.thirdPartyTasking.processors.eas.EasJobClosureProcessor.process(EasJobClosureProcessor.java:57)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CapabilityBase.processMessage(CapabilityBase.java:58)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor$1.doInTransactionWithoutResult(CamelCapabilityProcessor.java:100)
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.executeCapabilityInANewTransaction(CamelCapabilityProcessor.java:92)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.process(CamelCapabilityProcessor.java:60)
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:244)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
Caused by
exception.message error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource oracle.ewmp in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on oracle.jdbc.driver.T4CConnection@29d4d290 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state STARTED
exception.class java.sql.SQLException
bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:87)
bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:242)
sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64)
com.sun.proxy.$Proxy24.prepareStatement(Unknown Source)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:161)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1858)
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1835)
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1815)
org.hibernate.loader.Loader.doQuery(Loader.java:899)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:311)
org.hibernate.loader.Loader.loadCollection(Loader.java:2234)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1849)
org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549)
org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234)
org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
org.hibernate.collection.internal.AbstractPersistentCollection.write(AbstractPersistentCollection.java:370)
org.hibernate.collection.internal.PersistentBag.add(PersistentBag.java:291)
com.bt.ewmp.workFlow.thirdPartyTasking.allocations.PeriodAllocationsGroup.recordFailure(PeriodAllocationsGroup.java:218)
com.bt.ewmp.workFlow.thirdPartyTasking.tasks.eas.JobClosureAtEasTask.recordFailuresAndPersistPeriodAllocationsGroups(JobClosureAtEasTask.java:54)
com.bt.ewmp.workFlow.thirdPartyTasking.tasks.eas.JobClosureAtEasTask.execute(JobClosureAtEasTask.java:42)
com.bt.ewmp.workFlow.thirdPartyTasking.processors.eas.EasJobClosureProcessor.process(EasJobClosureProcessor.java:57)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CapabilityBase.processMessage(CapabilityBase.java:58)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor$1.doInTransactionWithoutResult(CamelCapabilityProcessor.java:100)
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.executeCapabilityInANewTransaction(CamelCapabilityProcessor.java:92)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.process(CamelCapabilityProcessor.java:60)
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:244)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
Caused by
exception.message transaction timed out
exception.class bitronix.tm.internal.BitronixSystemException
bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:85)
bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:242)
sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64)
com.sun.proxy.$Proxy24.prepareStatement(Unknown Source)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:161)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1858)
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1835)
org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1815)
org.hibernate.loader.Loader.doQuery(Loader.java:899)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:311)
org.hibernate.loader.Loader.loadCollection(Loader.java:2234)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1849)
org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:549)
org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:234)
org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:545)
org.hibernate.collection.internal.AbstractPersistentCollection.write(AbstractPersistentCollection.java:370)
org.hibernate.collection.internal.PersistentBag.add(PersistentBag.java:291)
com.bt.ewmp.workFlow.thirdPartyTasking.allocations.PeriodAllocationsGroup.recordFailure(PeriodAllocationsGroup.java:218)
com.bt.ewmp.workFlow.thirdPartyTasking.tasks.eas.JobClosureAtEasTask.recordFailuresAndPersistPeriodAllocationsGroups(JobClosureAtEasTask.java:54)
com.bt.ewmp.workFlow.thirdPartyTasking.tasks.eas.JobClosureAtEasTask.execute(JobClosureAtEasTask.java:42)
com.bt.ewmp.workFlow.thirdPartyTasking.processors.eas.EasJobClosureProcessor.process(EasJobClosureProcessor.java:57)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CapabilityBase.processMessage(CapabilityBase.java:58)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor$1.doInTransactionWithoutResult(CamelCapabilityProcessor.java:100)
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.executeCapabilityInANewTransaction(CamelCapabilityProcessor.java:92)
com.bt.ewmp.workFlow.thirdPartyTasking.capability.CamelCapabilityProcessor.process(CamelCapabilityProcessor.java:60)
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:244)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1069)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1061)
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:958)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
This post has NOT been accepted by the mailing list yet.
In reply to this post by jayantvaish5
Can anyone please give an update on this.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Frequently getting "error enlisting a JdbcConnectionHandle..."

rramchandhar
This post has NOT been accepted by the mailing list yet.

I have not seen anything from bitronix, as this post was not accepted by them, and yours as well. Did you get any response for yours?

 

Regards

Ram Chandhar Rapolu

Mobile : 07713444695

Meetme : UK Freefone:0800 012 1176, PIN: 28339077 then #

 

From: jayantvaish5 [via Bitronix Transaction Manager] [mailto:[hidden email]]
Sent: 16 October 2013 07:31
To: Rapolu,RC,Ram Chandhar,TAW6 C
Subject: Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

 

Can anyone please give an update on this.


To unsubscribe from Frequently getting "error enlisting a JdbcConnectionHandle...", click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
Hello Ram,

I didn't got any response till now.. Still waiting.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Frequently getting "error enlisting a JdbcConnectionHandle..."

Anil Hemnani

It looks transaction time out. Does your processing between begin and commit takin very long time?

I also saw you are setting pool size in 100s. Though not related to your issue but why woukd you need such a large number of connections?

On 17 Oct 2013 17:49, "jayantvaish5" <[hidden email]> wrote:
Hello Ram,

I didn't got any response till now.. Still waiting.



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1551.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
Hello Anil,

Firstly thanks for responding to this thread.
Processing between begin and commit doesn't takes time, if it takes time we can increase the timeout value.. But I see it's not able to enlist the connection:

Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed out
        at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)


Also our application is used by high number of threads which need multiple transaction at same time that's why we have set the pool size to high number and corresponding database is also capable to handle these number of connections.

Would like to know why it would give error due to:

bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)


Thanks,
Jayant
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Frequently getting "error enlisting a JdbcConnectionHandle..."

Ludovic Orban-2
Hi,

> Processing between begin and commit doesn't takes time


What makes you believe so? Can you prove it?


> if it takes time we  can increase the timeout value

Why don't you give that a try?


enlistInCurrentTransaction() is called because you're using a jdbc connection within a JTA transaction context which implies the connection's XA resource must be enlisted in the transaction. Since enlisting a resource in a timed out transaction is not allowed, an exception is thrown with a reasonably clear error message.

Everything tends to indicate that your transaction timed out. If you believe it's not the case, then you should try to collect evidences about that and try to create a reproducible test program we could debug.




On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]> wrote:
Hello Anil,

Firstly thanks for responding to this thread.
Processing between begin and commit doesn't takes time, if it takes time we
can increase the timeout value.. But I see it's not able to enlist the
connection:

Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed
out
        at
*bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
*


Also our application is used by high number of threads which need multiple
transaction at same time that's why we have set the pool size to high number
and corresponding database is also capable to handle these number of
connections.

Would like to know why it would give error due to:

*bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
*


Thanks,
Jayant



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
We tried increasing the timeout to 3 minutes, but we are getting this intermittent. Processing between begin and commit will not take such time as it's only one query to database where the data is also very less, we are using this for testing purpose.

I think processing is still not started as the resource is not enlisted. So, why we are thinking of processing time between begin and commit. Am I right? or if not can you please tell me how the cycle goes.


As you said:
>> enlistInCurrentTransaction() is called because you're using a jdbc connection within a JTA transaction context which implies the connection's XA resource must be enlisted in the transaction. Since enlisting a resource in a timed out transaction is not allowed, an exception is thrown with a reasonably clear error message.

I do not get this error message always, it's intermittent. So, why you would say "enlisting a resource in a timed out transaction is not allowed"

Please help me to understand this.



On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix Transaction Manager] <[hidden email]> wrote:
Hi,


> Processing between begin and commit doesn't takes time


What makes you believe so? Can you prove it?



> if it takes time we  can increase the timeout value

Why don't you give that a try?


enlistInCurrentTransaction() is called because you're using a jdbc connection within a JTA transaction context which implies the connection's XA resource must be enlisted in the transaction. Since enlisting a resource in a timed out transaction is not allowed, an exception is thrown with a reasonably clear error message.

Everything tends to indicate that your transaction timed out. If you believe it's not the case, then you should try to collect evidences about that and try to create a reproducible test program we could debug.




On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]> wrote:
Hello Anil,

Firstly thanks for responding to this thread.
Processing between begin and commit doesn't takes time, if it takes time we
can increase the timeout value.. But I see it's not able to enlist the
connection:

Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed
out
        at
*bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
*



Also our application is used by high number of threads which need multiple
transaction at same time that's why we have set the pool size to high number
and corresponding database is also capable to handle these number of
connections.

Would like to know why it would give error due to:

*bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
*


Thanks,
Jayant



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html

Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email






To unsubscribe from Frequently getting "error enlisting a JdbcConnectionHandle...", click here.
NAML



--
Thanks and Regards,
Jayant Vaish
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

Anil Hemnani

How do you start your transactions? I mean do you use UserTransaction and start programatically or via Spring etc?

Enable the bitronix logs and you will find more information.

On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]> wrote:
We tried increasing the timeout to 3 minutes, but we are getting this
intermittent. Processing between begin and commit will not take such time
as it's only one query to database where the data is also very less, we are
using this for testing purpose.

I think processing is still not started as the resource is not enlisted.
So, why we are thinking of processing time between begin and commit. Am I
right? or if not can you please tell me how the cycle goes.


As you said:
>> enlistInCurrentTransaction() is called because you're using a jdbc
connection within a JTA transaction context which implies the connection's
XA resource must be enlisted in the transaction. *Since enlisting a
resource in a timed out transaction is not allowed, an exception is thrown
with a reasonably clear error message.*

I do not get this error message always, it's intermittent. So, why you
would say "*enlisting a resource in a timed out transaction is not allowed"*
*
*
Please help me to understand this.



On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> Hi,
>
> *
> > Processing between begin and commit doesn't takes time*
>
> What makes you believe so? Can you prove it?
>
>
>
> *> if it takes time we  can increase the timeout value
> *
> Why don't you give that a try?
>
>
> enlistInCurrentTransaction() is called because you're using a jdbc
> connection within a JTA transaction context which implies the connection's
> XA resource must be enlisted in the transaction. Since enlisting a resource
> in a timed out transaction is not allowed, an exception is thrown with a
> reasonably clear error message.
>
> Everything tends to indicate that your transaction timed out. If you
> believe it's not the case, then you should try to collect evidences about
> that and try to create a reproducible test program we could debug.
>
>
>
>
> On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<http://user/SendEmail.jtp?type=node&node=1554&i=0>
> > wrote:
>
>> Hello Anil,
>>
>> Firstly thanks for responding to this thread.
>> Processing between begin and commit doesn't takes time, if it takes time
>> we
>> can increase the timeout value.. But I see it's not able to enlist the
>> connection:
>>
>> Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed
>> out
>>         at
>>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> *
>>
>>
>>
>> Also our application is used by high number of threads which need multiple
>> transaction at same time that's why we have set the pool size to high
>> number
>> and corresponding database is also capable to handle these number of
>> connections.
>>
>> Would like to know why it would give error due to:
>>
>>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> *
>>
>>
>> Thanks,
>> Jayant
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>  To unsubscribe from Frequently getting "error enlisting a
> JdbcConnectionHandle...", click here< > .
> NAML<
http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Thanks and Regards,
Jayant Vaish




--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
We start the transaction programatically, will debug the logs. If you can throw some light about in what scenarios this issue can come it would be very helpful. 


On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix Transaction Manager] <[hidden email]> wrote:

How do you start your transactions? I mean do you use UserTransaction and start programatically or via Spring etc?

Enable the bitronix logs and you will find more information.

On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]> wrote:
We tried increasing the timeout to 3 minutes, but we are getting this
intermittent. Processing between begin and commit will not take such time
as it's only one query to database where the data is also very less, we are
using this for testing purpose.

I think processing is still not started as the resource is not enlisted.
So, why we are thinking of processing time between begin and commit. Am I
right? or if not can you please tell me how the cycle goes.


As you said:
>> enlistInCurrentTransaction() is called because you're using a jdbc
connection within a JTA transaction context which implies the connection's
XA resource must be enlisted in the transaction. *Since enlisting a

resource in a timed out transaction is not allowed, an exception is thrown
with a reasonably clear error message.*


I do not get this error message always, it's intermittent. So, why you
would say "*enlisting a resource in a timed out transaction is not allowed"*
*
*

Please help me to understand this.



On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> Hi,
>
> *
> > Processing between begin and commit doesn't takes time*

>
> What makes you believe so? Can you prove it?
>
>
>
> *> if it takes time we  can increase the timeout value

> *
> Why don't you give that a try?
>
>
> enlistInCurrentTransaction() is called because you're using a jdbc
> connection within a JTA transaction context which implies the connection's
> XA resource must be enlisted in the transaction. Since enlisting a resource
> in a timed out transaction is not allowed, an exception is thrown with a
> reasonably clear error message.
>
> Everything tends to indicate that your transaction timed out. If you
> believe it's not the case, then you should try to collect evidences about
> that and try to create a reproducible test program we could debug.
>
>
>
>
> On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<http://user/SendEmail.jtp?type=node&node=1554&i=0>

> > wrote:
>
>> Hello Anil,
>>
>> Firstly thanks for responding to this thread.
>> Processing between begin and commit doesn't takes time, if it takes time
>> we
>> can increase the timeout value.. But I see it's not able to enlist the
>> connection:
>>
>> Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed
>> out
>>         at
>>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> *
>>
>>
>>
>> Also our application is used by high number of threads which need multiple
>> transaction at same time that's why we have set the pool size to high
>> number
>> and corresponding database is also capable to handle these number of
>> connections.
>>
>> Would like to know why it would give error due to:
>>
>>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> *
>>
>>
>> Thanks,
>> Jayant
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
> ------------------------------

>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>  To unsubscribe from Frequently getting "error enlisting a
> JdbcConnectionHandle...", click here<
> .
> NAML<
http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

>



--
Thanks and Regards,
Jayant Vaish




--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html

Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





To unsubscribe from Frequently getting "error enlisting a JdbcConnectionHandle...", click here.
NAML



--
Thanks and Regards,
Jayant Vaish
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

Ludovic Orban-2
> why you would say "*enlisting a resource in a timed out transaction is not allowed"

That's per JTA spec. But it's logical: allowing enlistment of a resource in a timed out transaction means allowing that resource to make some work that can only be rolled back. It's useless so the transaction manager refuses the enlistment to prevent wasting resources.


The timeout clock starts ticking right when you call begin() and stops when you call commit() or rollback(). By the way, you have to roll back timed out transactions, you cannot leave them pending.

As suggested earlier, enable debug logs and check them out. They include some info about the timeout itself so they certainly can help you figuring out what's going on.



On Thu, Oct 17, 2013 at 8:24 PM, jayantvaish5 <[hidden email]> wrote:
We start the transaction programatically, will debug the logs. If you can
throw some light about in what scenarios this issue can come it would be
very helpful.


On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> How do you start your transactions? I mean do you use UserTransaction and
> start programatically or via Spring etc?
>
> Enable the bitronix logs and you will find more information.
>
>  On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]<http://user/SendEmail.jtp?type=node&node=1556&i=0>>
> wrote:
>
>> We tried increasing the timeout to 3 minutes, but we are getting this
>> intermittent. Processing between begin and commit will not take such time
>> as it's only one query to database where the data is also very less, we
>> are
>> using this for testing purpose.
>>
>> I think processing is still not started as the resource is not enlisted.
>> So, why we are thinking of processing time between begin and commit. Am I
>> right? or if not can you please tell me how the cycle goes.
>>
>>
>> As you said:
>> >> enlistInCurrentTransaction() is called because you're using a jdbc
>> connection within a JTA transaction context which implies the connection's
>> XA resource must be enlisted in the transaction. *Since enlisting a
>>
>> resource in a timed out transaction is not allowed, an exception is thrown
>> with a reasonably clear error message.*
>>
>>
>> I do not get this error message always, it's intermittent. So, why you
>> would say "*enlisting a resource in a timed out transaction is not
>> allowed"*
>> *
>> *
>>
>> Please help me to understand this.
>>
>>
>>
>> On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix
>> Transaction
>> Manager] <[hidden email]<http://user/SendEmail.jtp?type=node&node=1556&i=1>>
>> wrote:
>>
>> > Hi,
>> >
>> > *
>> > > Processing between begin and commit doesn't takes time*
>>
>> >
>> > What makes you believe so? Can you prove it?
>> >
>> >
>> >
>> > *> if it takes time we  can increase the timeout value
>>
>> > *
>> > Why don't you give that a try?
>> >
>> >
>> > enlistInCurrentTransaction() is called because you're using a jdbc
>> > connection within a JTA transaction context which implies the
>> connection's
>> > XA resource must be enlisted in the transaction. Since enlisting a
>> resource
>> > in a timed out transaction is not allowed, an exception is thrown with a
>> > reasonably clear error message.
>> >
>> > Everything tends to indicate that your transaction timed out. If you
>> > believe it's not the case, then you should try to collect evidences
>> about
>> > that and try to create a reproducible test program we could debug.
>> >
>> >
>> >
>> >
>> > On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1554&i=0>
>>
>> > > wrote:
>> >
>> >> Hello Anil,
>> >>
>> >> Firstly thanks for responding to this thread.
>> >> Processing between begin and commit doesn't takes time, if it takes
>> time
>> >> we
>> >> can increase the timeout value.. But I see it's not able to enlist the
>> >> connection:
>> >>
>> >> Caused by: bitronix.tm.internal.BitronixSystemException: transaction
>> timed
>> >> out
>> >>         at
>> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> *
>> >>
>> >>
>> >>
>> >> Also our application is used by high number of threads which need
>> multiple
>> >> transaction at same time that's why we have set the pool size to high
>> >> number
>> >> and corresponding database is also capable to handle these number of
>> >> connections.
>> >>
>> >> Would like to know why it would give error due to:
>> >>
>> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> *
>> >>
>> >>
>> >> Thanks,
>> >> Jayant
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>> >>
>> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >
>> > ------------------------------
>>
>> >  If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> >
>> >
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>> >  To unsubscribe from Frequently getting "error enlisting a
>> > JdbcConnectionHandle...", click here<
>> > .
>> > NAML<
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>>
>> >
>>
>>
>>
>> --
>> Thanks and Regards,
>> Jayant Vaish
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1556.html
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1557.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
Hello, 

I have taken the thread dump at time this issue occurred and I see following thread is in BLOCKED state:

"Server-50" daemon prio=10 tid=0x000000004d7c1800 nid=0x2215 waiting for monitor entry [0x00002b81cbc40000]
     java.lang.Thread.State: BLOCKED (on object monitor)
     at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java)
     - waiting to lock <0x00000006cc3066f0> (a bitronix.tm.resource.common.XAPool)
     at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:258)
     at JdbcDelegate.getConnection(JdbcDelegate.java:295)
     at JdbcDelegate.deleteJob(JdbcDelegate.java:100)
     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:468)
     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:465)
     at SimpleScheduler.execTransaction(SimpleScheduler.java:223)
     at SimpleScheduler$RunJob.call(SimpleScheduler.java:465)
     at SimpleScheduler$RunJob.call(SimpleScheduler.java:449)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:662)

Looking the bitronix code I find:

public synchronized Object getConnectionHandle() throws Exception {
        return getConnectionHandle(true);
    }

This method is synchronized. So, when multiple threads are working and beginning transaction each one will get connection handle one by one other will be in BLOCKED. This could be the reason of this timeout issue. 

Please advice.

Thanks,
Jayant 


On Fri, Oct 18, 2013 at 12:01 AM, Ludovic Orban-2 [via Bitronix Transaction Manager] <[hidden email]> wrote:
> why you would say "*enlisting a resource in a timed out transaction is not allowed"

That's per JTA spec. But it's logical: allowing enlistment of a resource in a timed out transaction means allowing that resource to make some work that can only be rolled back. It's useless so the transaction manager refuses the enlistment to prevent wasting resources.


The timeout clock starts ticking right when you call begin() and stops when you call commit() or rollback(). By the way, you have to roll back timed out transactions, you cannot leave them pending.

As suggested earlier, enable debug logs and check them out. They include some info about the timeout itself so they certainly can help you figuring out what's going on.



On Thu, Oct 17, 2013 at 8:24 PM, jayantvaish5 <[hidden email]> wrote:
We start the transaction programatically, will debug the logs. If you can
throw some light about in what scenarios this issue can come it would be
very helpful.


On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> How do you start your transactions? I mean do you use UserTransaction and
> start programatically or via Spring etc?
>
> Enable the bitronix logs and you will find more information.
>
>  On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]<http://user/SendEmail.jtp?type=node&node=1556&i=0>>

> wrote:
>
>> We tried increasing the timeout to 3 minutes, but we are getting this
>> intermittent. Processing between begin and commit will not take such time
>> as it's only one query to database where the data is also very less, we
>> are
>> using this for testing purpose.
>>
>> I think processing is still not started as the resource is not enlisted.
>> So, why we are thinking of processing time between begin and commit. Am I
>> right? or if not can you please tell me how the cycle goes.
>>
>>
>> As you said:
>> >> enlistInCurrentTransaction() is called because you're using a jdbc
>> connection within a JTA transaction context which implies the connection's
>> XA resource must be enlisted in the transaction. *Since enlisting a
>>
>> resource in a timed out transaction is not allowed, an exception is thrown
>> with a reasonably clear error message.*
>>
>>
>> I do not get this error message always, it's intermittent. So, why you
>> would say "*enlisting a resource in a timed out transaction is not
>> allowed"*
>> *
>> *
>>
>> Please help me to understand this.
>>
>>
>>
>> On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix
>> Transaction
>> Manager] <[hidden email]<http://user/SendEmail.jtp?type=node&node=1556&i=1>>

>> wrote:
>>
>> > Hi,
>> >
>> > *
>> > > Processing between begin and commit doesn't takes time*
>>
>> >
>> > What makes you believe so? Can you prove it?
>> >
>> >
>> >
>> > *> if it takes time we  can increase the timeout value
>>
>> > *
>> > Why don't you give that a try?
>> >
>> >
>> > enlistInCurrentTransaction() is called because you're using a jdbc
>> > connection within a JTA transaction context which implies the
>> connection's
>> > XA resource must be enlisted in the transaction. Since enlisting a
>> resource
>> > in a timed out transaction is not allowed, an exception is thrown with a
>> > reasonably clear error message.
>> >
>> > Everything tends to indicate that your transaction timed out. If you
>> > believe it's not the case, then you should try to collect evidences
>> about
>> > that and try to create a reproducible test program we could debug.
>> >
>> >
>> >
>> >
>> > On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1554&i=0>
>>
>> > > wrote:
>> >
>> >> Hello Anil,
>> >>
>> >> Firstly thanks for responding to this thread.
>> >> Processing between begin and commit doesn't takes time, if it takes
>> time
>> >> we
>> >> can increase the timeout value.. But I see it's not able to enlist the
>> >> connection:
>> >>
>> >> Caused by: bitronix.tm.internal.BitronixSystemException: transaction
>> timed
>> >> out
>> >>         at
>> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> *
>> >>
>> >>
>> >>
>> >> Also our application is used by high number of threads which need
>> multiple
>> >> transaction at same time that's why we have set the pool size to high
>> >> number
>> >> and corresponding database is also capable to handle these number of
>> >> connections.
>> >>
>> >> Would like to know why it would give error due to:
>> >>
>> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> *
>> >>
>> >>
>> >> Thanks,
>> >> Jayant
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>> >>
>> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >
>> > ------------------------------
>>
>> >  If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> >
>> >
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>> >  To unsubscribe from Frequently getting "error enlisting a
>> > JdbcConnectionHandle...", click here<
>> > .
>> > NAML<
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>>
>> >
>>
>>
>>
>> --
>> Thanks and Regards,
>> Jayant Vaish
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1556.html
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1557.html

Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email






To unsubscribe from Frequently getting "error enlisting a JdbcConnectionHandle...", click here.
NAML



--
Thanks and Regards,
Jayant Vaish
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

Anil Hemnani

Could you share your code where you begin and commit the transactions?

Did you enable the bitronix logs and tried to investigate what is happening?

On 19 Oct 2013 06:03, "jayantvaish5" <[hidden email]> wrote:
Hello,

I have taken the thread dump at time this issue occurred and I see
following thread is in BLOCKED state:

"Server-50" daemon prio=10 tid=0x000000004d7c1800 nid=0x2215 waiting for
monitor entry [0x00002b81cbc40000]
     java.lang.Thread.State: BLOCKED (on object monitor)
     at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java)
     - waiting to lock
<0x00000006cc3066f0<http://../sequence/threadId-0x000000004da3a000_shrink-true.html#0x00000006cc3066f0_22>>
(a bitronix.tm.resource.common.XAPool)
     at
bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:258)
     at JdbcDelegate.getConnection(JdbcDelegate.java:295)
     at JdbcDelegate.deleteJob(JdbcDelegate.java:100)
     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:468)
     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:465)
     at SimpleScheduler.execTransaction(SimpleScheduler.java:223)
     at SimpleScheduler$RunJob.call(SimpleScheduler.java:465)
     at SimpleScheduler$RunJob.call(SimpleScheduler.java:449)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:662)

Looking the bitronix code I find:

public synchronized Object getConnectionHandle() throws Exception {
        return getConnectionHandle(true);
    }

This method is synchronized. So, when multiple threads are working and
beginning transaction each one will get connection handle one by one other
will be in BLOCKED. This could be the reason of this timeout issue.

Please advice.

Thanks,
Jayant


On Fri, Oct 18, 2013 at 12:01 AM, Ludovic Orban-2 [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> *> why you would say "*enlisting a resource in a timed out transaction is
> not allowed"
>
> *
> That's per JTA spec. But it's logical: allowing enlistment of a resource
> in a timed out transaction means allowing that resource to make some work
> that can only be rolled back. It's useless so the transaction manager
> refuses the enlistment to prevent wasting resources.
>
>
> The timeout clock starts ticking right when you call begin() and stops
> when you call commit() or rollback(). By the way, you have to roll back
> timed out transactions, you cannot leave them pending.
>
> As suggested earlier, enable debug logs and check them out. They include
> some info about the timeout itself so they certainly can help you figuring
> out what's going on.
>
>
>
> On Thu, Oct 17, 2013 at 8:24 PM, jayantvaish5 <[hidden email]<http://user/SendEmail.jtp?type=node&node=1558&i=0>
> > wrote:
>
>> We start the transaction programatically, will debug the logs. If you can
>> throw some light about in what scenarios this issue can come it would be
>> very helpful.
>>
>>
>> On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix Transaction
>> Manager] <[hidden email]<http://user/SendEmail.jtp?type=node&node=1558&i=1>>
>> wrote:
>>
>> > How do you start your transactions? I mean do you use UserTransaction
>> and
>> > start programatically or via Spring etc?
>> >
>> > Enable the bitronix logs and you will find more information.
>> >
>> >  On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1556&i=0>>
>>
>> > wrote:
>> >
>> >> We tried increasing the timeout to 3 minutes, but we are getting this
>> >> intermittent. Processing between begin and commit will not take such
>> time
>> >> as it's only one query to database where the data is also very less, we
>> >> are
>> >> using this for testing purpose.
>> >>
>> >> I think processing is still not started as the resource is not
>> enlisted.
>> >> So, why we are thinking of processing time between begin and commit.
>> Am I
>> >> right? or if not can you please tell me how the cycle goes.
>> >>
>> >>
>> >> As you said:
>> >> >> enlistInCurrentTransaction() is called because you're using a jdbc
>> >> connection within a JTA transaction context which implies the
>> connection's
>> >> XA resource must be enlisted in the transaction. *Since enlisting a
>> >>
>> >> resource in a timed out transaction is not allowed, an exception is
>> thrown
>> >> with a reasonably clear error message.*
>> >>
>> >>
>> >> I do not get this error message always, it's intermittent. So, why you
>> >> would say "*enlisting a resource in a timed out transaction is not
>> >> allowed"*
>> >> *
>> >> *
>> >>
>> >> Please help me to understand this.
>> >>
>> >>
>> >>
>> >> On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix
>> >> Transaction
>> >> Manager] <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1556&i=1>>
>>
>> >> wrote:
>> >>
>> >> > Hi,
>> >> >
>> >> > *
>> >> > > Processing between begin and commit doesn't takes time*
>> >>
>> >> >
>> >> > What makes you believe so? Can you prove it?
>> >> >
>> >> >
>> >> >
>> >> > *> if it takes time we  can increase the timeout value
>> >>
>> >> > *
>> >> > Why don't you give that a try?
>> >> >
>> >> >
>> >> > enlistInCurrentTransaction() is called because you're using a jdbc
>> >> > connection within a JTA transaction context which implies the
>> >> connection's
>> >> > XA resource must be enlisted in the transaction. Since enlisting a
>> >> resource
>> >> > in a timed out transaction is not allowed, an exception is thrown
>> with a
>> >> > reasonably clear error message.
>> >> >
>> >> > Everything tends to indicate that your transaction timed out. If you
>> >> > believe it's not the case, then you should try to collect evidences
>> >> about
>> >> > that and try to create a reproducible test program we could debug.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<
>> >> http://user/SendEmail.jtp?type=node&node=1554&i=0>
>> >>
>> >> > > wrote:
>> >> >
>> >> >> Hello Anil,
>> >> >>
>> >> >> Firstly thanks for responding to this thread.
>> >> >> Processing between begin and commit doesn't takes time, if it takes
>> >> time
>> >> >> we
>> >> >> can increase the timeout value.. But I see it's not able to enlist
>> the
>> >> >> connection:
>> >> >>
>> >> >> Caused by: bitronix.tm.internal.BitronixSystemException: transaction
>> >> timed
>> >> >> out
>> >> >>         at
>> >> >>
>> >> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> >> *
>> >> >>
>> >> >>
>> >> >>
>> >> >> Also our application is used by high number of threads which need
>> >> multiple
>> >> >> transaction at same time that's why we have set the pool size to
>> high
>> >> >> number
>> >> >> and corresponding database is also capable to handle these number of
>> >> >> connections.
>> >> >>
>> >> >> Would like to know why it would give error due to:
>> >> >>
>> >> >>
>> >> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> >> *
>> >> >>
>> >> >>
>> >> >> Thanks,
>> >> >> Jayant
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>> >> >>
>> >> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> >> Nabble.com.
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe from this list, please visit:
>> >> >>
>> >> >>     http://xircles.codehaus.org/manage_email
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > ------------------------------
>> >>
>> >> >  If you reply to this email, your message will be added to the
>> >> discussion
>> >> > below:
>> >> >
>> >> >
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>> >> >  To unsubscribe from Frequently getting "error enlisting a
>> >> > JdbcConnectionHandle...", click here<
>> >> > .
>> >> > NAML<
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >> >
>> >>
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks and Regards,
>> >> Jayant Vaish
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
>> >>
>> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> > ------------------------------
>> >  If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> >
>> >
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1556.html
>> >  To unsubscribe from Frequently getting "error enlisting a
>> > JdbcConnectionHandle...", click here< > .
>> > NAML<
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >
>>
>>
>>
>> --
>> Thanks and Regards,
>> Jayant Vaish
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1557.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1558.html
>  To unsubscribe from Frequently getting "error enlisting a
> JdbcConnectionHandle...", click here< > .
> NAML<
http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Thanks and Regards,
Jayant Vaish




--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1559.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

jayantvaish5
Do we need to enable bitronix.tm=DEBUG or Is there any particular classes we can enable for debug?

Also which logs should we enable to check time it takes to run transaction?



On Sat, Oct 19, 2013 at 10:38 AM, Anil Hemnani [via Bitronix Transaction Manager] <[hidden email]> wrote:

Could you share your code where you begin and commit the transactions?

Did you enable the bitronix logs and tried to investigate what is happening?

On 19 Oct 2013 06:03, "jayantvaish5" <[hidden email]> wrote:
Hello,

I have taken the thread dump at time this issue occurred and I see
following thread is in BLOCKED state:

"Server-50" daemon prio=10 tid=0x000000004d7c1800 nid=0x2215 waiting for
monitor entry [0x00002b81cbc40000]
     java.lang.Thread.State: BLOCKED (on object monitor)
     at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java)
     - waiting to lock
<0x00000006cc3066f0<http://../sequence/threadId-0x000000004da3a000_shrink-true.html#0x00000006cc3066f0_22>>

(a bitronix.tm.resource.common.XAPool)
     at
bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:258)
     at JdbcDelegate.getConnection(JdbcDelegate.java:295)
     at JdbcDelegate.deleteJob(JdbcDelegate.java:100)
     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:468)
     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:465)
     at SimpleScheduler.execTransaction(SimpleScheduler.java:223)
     at SimpleScheduler$RunJob.call(SimpleScheduler.java:465)
     at SimpleScheduler$RunJob.call(SimpleScheduler.java:449)
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:662)

Looking the bitronix code I find:

public synchronized Object getConnectionHandle() throws Exception {
        return getConnectionHandle(true);
    }

This method is synchronized. So, when multiple threads are working and
beginning transaction each one will get connection handle one by one other
will be in BLOCKED. This could be the reason of this timeout issue.

Please advice.

Thanks,
Jayant


On Fri, Oct 18, 2013 at 12:01 AM, Ludovic Orban-2 [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> *> why you would say "*enlisting a resource in a timed out transaction is
> not allowed"
>
> *

> That's per JTA spec. But it's logical: allowing enlistment of a resource
> in a timed out transaction means allowing that resource to make some work
> that can only be rolled back. It's useless so the transaction manager
> refuses the enlistment to prevent wasting resources.
>
>
> The timeout clock starts ticking right when you call begin() and stops
> when you call commit() or rollback(). By the way, you have to roll back
> timed out transactions, you cannot leave them pending.
>
> As suggested earlier, enable debug logs and check them out. They include
> some info about the timeout itself so they certainly can help you figuring
> out what's going on.
>
>
>
> On Thu, Oct 17, 2013 at 8:24 PM, jayantvaish5 <[hidden email]<http://user/SendEmail.jtp?type=node&node=1558&i=0>

> > wrote:
>
>> We start the transaction programatically, will debug the logs. If you can
>> throw some light about in what scenarios this issue can come it would be
>> very helpful.
>>
>>
>> On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix Transaction
>> Manager] <[hidden email]<http://user/SendEmail.jtp?type=node&node=1558&i=1>>

>> wrote:
>>
>> > How do you start your transactions? I mean do you use UserTransaction
>> and
>> > start programatically or via Spring etc?
>> >
>> > Enable the bitronix logs and you will find more information.
>> >
>> >  On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1556&i=0>>
>>
>> > wrote:
>> >
>> >> We tried increasing the timeout to 3 minutes, but we are getting this
>> >> intermittent. Processing between begin and commit will not take such
>> time
>> >> as it's only one query to database where the data is also very less, we
>> >> are
>> >> using this for testing purpose.
>> >>
>> >> I think processing is still not started as the resource is not
>> enlisted.
>> >> So, why we are thinking of processing time between begin and commit.
>> Am I
>> >> right? or if not can you please tell me how the cycle goes.
>> >>
>> >>
>> >> As you said:
>> >> >> enlistInCurrentTransaction() is called because you're using a jdbc
>> >> connection within a JTA transaction context which implies the
>> connection's
>> >> XA resource must be enlisted in the transaction. *Since enlisting a
>> >>
>> >> resource in a timed out transaction is not allowed, an exception is
>> thrown
>> >> with a reasonably clear error message.*
>> >>
>> >>
>> >> I do not get this error message always, it's intermittent. So, why you
>> >> would say "*enlisting a resource in a timed out transaction is not
>> >> allowed"*
>> >> *
>> >> *
>> >>
>> >> Please help me to understand this.
>> >>
>> >>
>> >>
>> >> On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix
>> >> Transaction
>> >> Manager] <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1556&i=1>>
>>
>> >> wrote:
>> >>
>> >> > Hi,
>> >> >
>> >> > *
>> >> > > Processing between begin and commit doesn't takes time*
>> >>
>> >> >
>> >> > What makes you believe so? Can you prove it?
>> >> >
>> >> >
>> >> >
>> >> > *> if it takes time we  can increase the timeout value
>> >>
>> >> > *
>> >> > Why don't you give that a try?
>> >> >
>> >> >
>> >> > enlistInCurrentTransaction() is called because you're using a jdbc
>> >> > connection within a JTA transaction context which implies the
>> >> connection's
>> >> > XA resource must be enlisted in the transaction. Since enlisting a
>> >> resource
>> >> > in a timed out transaction is not allowed, an exception is thrown
>> with a
>> >> > reasonably clear error message.
>> >> >
>> >> > Everything tends to indicate that your transaction timed out. If you
>> >> > believe it's not the case, then you should try to collect evidences
>> >> about
>> >> > that and try to create a reproducible test program we could debug.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<
>> >> http://user/SendEmail.jtp?type=node&node=1554&i=0>
>> >>
>> >> > > wrote:
>> >> >
>> >> >> Hello Anil,
>> >> >>
>> >> >> Firstly thanks for responding to this thread.
>> >> >> Processing between begin and commit doesn't takes time, if it takes
>> >> time
>> >> >> we
>> >> >> can increase the timeout value.. But I see it's not able to enlist
>> the
>> >> >> connection:
>> >> >>
>> >> >> Caused by: bitronix.tm.internal.BitronixSystemException: transaction
>> >> timed
>> >> >> out
>> >> >>         at
>> >> >>
>> >> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> >> *
>> >> >>
>> >> >>
>> >> >>
>> >> >> Also our application is used by high number of threads which need
>> >> multiple
>> >> >> transaction at same time that's why we have set the pool size to
>> high
>> >> >> number
>> >> >> and corresponding database is also capable to handle these number of
>> >> >> connections.
>> >> >>
>> >> >> Would like to know why it would give error due to:
>> >> >>
>> >> >>
>> >> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> >> *
>> >> >>
>> >> >>
>> >> >> Thanks,
>> >> >> Jayant
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>> >> >>
>> >> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> >> Nabble.com.
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe from this list, please visit:
>> >> >>
>> >> >>     http://xircles.codehaus.org/manage_email
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > ------------------------------
>> >>
>> >> >  If you reply to this email, your message will be added to the
>> >> discussion
>> >> > below:
>> >> >
>> >> >
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>> >> >  To unsubscribe from Frequently getting "error enlisting a
>> >> > JdbcConnectionHandle...", click here<
>> >> > .
>> >> > NAML<
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >> >
>> >>
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks and Regards,
>> >> Jayant Vaish
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
>> >>
>> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> > ------------------------------
>> >  If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> >
>> >
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1556.html
>> >  To unsubscribe from Frequently getting "error enlisting a
>> > JdbcConnectionHandle...", click here< > .
>> > NAML<
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >
>>
>>
>>
>> --
>> Thanks and Regards,
>> Jayant Vaish
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1557.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> JdbcConnectionHandle...", click here< > . View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1559.html

Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





To unsubscribe from Frequently getting "error enlisting a JdbcConnectionHandle...", click here.
NAML



--
Thanks and Regards,
Jayant Vaish
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

Anil Hemnani

There is plenty of information in btm website. It is log4j config or whatever logger you are using.

On 19 Oct 2013 06:24, "jayantvaish5" <[hidden email]> wrote:
Do we need to enable bitronix.tm=DEBUG or Is there any particular classes
we can enable for debug?

Also which logs should we enable to check time it takes to run transaction?


On Sat, Oct 19, 2013 at 10:38 AM, Anil Hemnani [via Bitronix Transaction
Manager] <[hidden email]> wrote:

> Could you share your code where you begin and commit the transactions?
>
> Did you enable the bitronix logs and tried to investigate what is
> happening?
> On 19 Oct 2013 06:03, "jayantvaish5" <[hidden email]<http://user/SendEmail.jtp?type=node&node=1560&i=0>>
> wrote:
>
>> Hello,
>>
>> I have taken the thread dump at time this issue occurred and I see
>> following thread is in BLOCKED state:
>>
>> "Server-50" daemon prio=10 tid=0x000000004d7c1800 nid=0x2215 waiting for
>> monitor entry [0x00002b81cbc40000]
>>      java.lang.Thread.State: BLOCKED (on object monitor)
>>      at
>> bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java)
>>      - waiting to lock
>> <0x00000006cc3066f0<http://
>> ../sequence/threadId-0x000000004da3a000_shrink-true.html#0x00000006cc3066f0_22>>
>>
>> (a bitronix.tm.resource.common.XAPool)
>>      at
>>
>> bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:258)
>>      at JdbcDelegate.getConnection(JdbcDelegate.java:295)
>>      at JdbcDelegate.deleteJob(JdbcDelegate.java:100)
>>      at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:468)
>>      at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:465)
>>      at SimpleScheduler.execTransaction(SimpleScheduler.java:223)
>>      at SimpleScheduler$RunJob.call(SimpleScheduler.java:465)
>>      at SimpleScheduler$RunJob.call(SimpleScheduler.java:449)
>>      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>      at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>      at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>      at java.lang.Thread.run(Thread.java:662)
>>
>> Looking the bitronix code I find:
>>
>> public synchronized Object getConnectionHandle() throws Exception {
>>         return getConnectionHandle(true);
>>     }
>>
>> This method is synchronized. So, when multiple threads are working and
>> beginning transaction each one will get connection handle one by one other
>> will be in BLOCKED. This could be the reason of this timeout issue.
>>
>> Please advice.
>>
>> Thanks,
>> Jayant
>>
>>
>> On Fri, Oct 18, 2013 at 12:01 AM, Ludovic Orban-2 [via Bitronix
>> Transaction
>> Manager] <[hidden email]<http://user/SendEmail.jtp?type=node&node=1560&i=1>>
>> wrote:
>>
>> > *> why you would say "*enlisting a resource in a timed out transaction
>> is
>> > not allowed"
>> >
>> > *
>>
>> > That's per JTA spec. But it's logical: allowing enlistment of a resource
>> > in a timed out transaction means allowing that resource to make some
>> work
>> > that can only be rolled back. It's useless so the transaction manager
>> > refuses the enlistment to prevent wasting resources.
>> >
>> >
>> > The timeout clock starts ticking right when you call begin() and stops
>> > when you call commit() or rollback(). By the way, you have to roll back
>> > timed out transactions, you cannot leave them pending.
>> >
>> > As suggested earlier, enable debug logs and check them out. They include
>> > some info about the timeout itself so they certainly can help you
>> figuring
>> > out what's going on.
>> >
>> >
>> >
>> > On Thu, Oct 17, 2013 at 8:24 PM, jayantvaish5 <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1558&i=0>
>>
>> > > wrote:
>> >
>> >> We start the transaction programatically, will debug the logs. If you
>> can
>> >> throw some light about in what scenarios this issue can come it would
>> be
>> >> very helpful.
>> >>
>> >>
>> >> On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix
>> Transaction
>> >> Manager] <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=1558&i=1>>
>>
>> >> wrote:
>> >>
>> >> > How do you start your transactions? I mean do you use UserTransaction
>> >> and
>> >> > start programatically or via Spring etc?
>> >> >
>> >> > Enable the bitronix logs and you will find more information.
>> >> >
>> >> >  On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]<
>> >> http://user/SendEmail.jtp?type=node&node=1556&i=0>>
>> >>
>> >> > wrote:
>> >> >
>> >> >> We tried increasing the timeout to 3 minutes, but we are getting
>> this
>> >> >> intermittent. Processing between begin and commit will not take such
>> >> time
>> >> >> as it's only one query to database where the data is also very
>> less, we
>> >> >> are
>> >> >> using this for testing purpose.
>> >> >>
>> >> >> I think processing is still not started as the resource is not
>> >> enlisted.
>> >> >> So, why we are thinking of processing time between begin and commit.
>> >> Am I
>> >> >> right? or if not can you please tell me how the cycle goes.
>> >> >>
>> >> >>
>> >> >> As you said:
>> >> >> >> enlistInCurrentTransaction() is called because you're using a
>> jdbc
>> >> >> connection within a JTA transaction context which implies the
>> >> connection's
>> >> >> XA resource must be enlisted in the transaction. *Since enlisting a
>> >> >>
>> >> >> resource in a timed out transaction is not allowed, an exception is
>> >> thrown
>> >> >> with a reasonably clear error message.*
>> >> >>
>> >> >>
>> >> >> I do not get this error message always, it's intermittent. So, why
>> you
>> >> >> would say "*enlisting a resource in a timed out transaction is not
>> >> >> allowed"*
>> >> >> *
>> >> >> *
>> >> >>
>> >> >> Please help me to understand this.
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix
>> >> >> Transaction
>> >> >> Manager] <[hidden email]<
>> >> http://user/SendEmail.jtp?type=node&node=1556&i=1>>
>> >>
>> >> >> wrote:
>> >> >>
>> >> >> > Hi,
>> >> >> >
>> >> >> > *
>> >> >> > > Processing between begin and commit doesn't takes time*
>> >> >>
>> >> >> >
>> >> >> > What makes you believe so? Can you prove it?
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > *> if it takes time we  can increase the timeout value
>> >> >>
>> >> >> > *
>> >> >> > Why don't you give that a try?
>> >> >> >
>> >> >> >
>> >> >> > enlistInCurrentTransaction() is called because you're using a jdbc
>> >> >> > connection within a JTA transaction context which implies the
>> >> >> connection's
>> >> >> > XA resource must be enlisted in the transaction. Since enlisting a
>> >> >> resource
>> >> >> > in a timed out transaction is not allowed, an exception is thrown
>> >> with a
>> >> >> > reasonably clear error message.
>> >> >> >
>> >> >> > Everything tends to indicate that your transaction timed out. If
>> you
>> >> >> > believe it's not the case, then you should try to collect
>> evidences
>> >> >> about
>> >> >> > that and try to create a reproducible test program we could debug.
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<
>> >> >> http://user/SendEmail.jtp?type=node&node=1554&i=0>
>> >> >>
>> >> >> > > wrote:
>> >> >> >
>> >> >> >> Hello Anil,
>> >> >> >>
>> >> >> >> Firstly thanks for responding to this thread.
>> >> >> >> Processing between begin and commit doesn't takes time, if it
>> takes
>> >> >> time
>> >> >> >> we
>> >> >> >> can increase the timeout value.. But I see it's not able to
>> enlist
>> >> the
>> >> >> >> connection:
>> >> >> >>
>> >> >> >> Caused by: bitronix.tm.internal.BitronixSystemException:
>> transaction
>> >> >> timed
>> >> >> >> out
>> >> >> >>         at
>> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> >> >> *
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> Also our application is used by high number of threads which need
>> >> >> multiple
>> >> >> >> transaction at same time that's why we have set the pool size to
>> >> high
>> >> >> >> number
>> >> >> >> and corresponding database is also capable to handle these
>> number of
>> >> >> >> connections.
>> >> >> >>
>> >> >> >> Would like to know why it would give error due to:
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>> >> >> >> *
>> >> >> >>
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >> Jayant
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> --
>> >> >> >> View this message in context:
>> >> >> >>
>> >> >>
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>> >> >> >>
>> >> >> >> Sent from the Bitronix Transaction Manager mailing list archive
>> at
>> >> >> >> Nabble.com.
>> >> >> >>
>> >> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe from this list, please visit:
>> >> >> >>
>> >> >> >>     http://xircles.codehaus.org/manage_email
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> > ------------------------------
>> >> >>
>> >> >> >  If you reply to this email, your message will be added to the
>> >> >> discussion
>> >> >> > below:
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>> >> >> >  To unsubscribe from Frequently getting "error enlisting a
>> >> >> > JdbcConnectionHandle...", click here<
>> >> >> > .
>> >> >> > NAML<
>> >> >>
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >> >> >
>> >> >>
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Thanks and Regards,
>> >> >> Jayant Vaish
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
>> >> >>
>> >> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> >> Nabble.com.
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe from this list, please visit:
>> >> >>
>> >> >>     http://xircles.codehaus.org/manage_email
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> > ------------------------------
>> >> >  If you reply to this email, your message will be added to the
>> >> discussion
>> >> > below:
>> >> >
>> >> >
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1556.html
>> >> >  To unsubscribe from Frequently getting "error enlisting a
>> >> > JdbcConnectionHandle...", click here< > .
>> >> > NAML<
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks and Regards,
>> >> Jayant Vaish
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1557.html
>> >>
>> >> Sent from the Bitronix Transaction Manager mailing list archive at
>> >> Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>     http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >
>> > ------------------------------
>> >  If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> >
>> >
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1558.html
>> >  To unsubscribe from Frequently getting "error enlisting a
>> > JdbcConnectionHandle...", click here< > .
>>
>> > NAML<
>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >
>>
>>
>>
>> --
>> Thanks and Regards,
>> Jayant Vaish
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1559.html
>>
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1560.html
>  To unsubscribe from Frequently getting "error enlisting a
> JdbcConnectionHandle...", click here< > .
> NAML<
http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Thanks and Regards,
Jayant Vaish




--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1561.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

Brett Wooldridge-2
In reply to this post by jayantvaish5
While in btm 2.x the getConnection() method is synchronized, the
duration in typically very short (milliseconds), unless:

1. All connections are in use, or
2. A new connection is taking an extraordinarily long time to acquire

So, I would also investigate whether you have a connection leak, code
that is calling getConnection() but never closing it.  getConnection()
should always be acquired just before a try block and closed in the
finally.

Brett

Sent from my iPad

> On Oct 19, 2013, at 14:02, jayantvaish5 <[hidden email]> wrote:
>
> Hello,
>
> I have taken the thread dump at time this issue occurred and I see
> following thread is in BLOCKED state:
>
> "Server-50" daemon prio=10 tid=0x000000004d7c1800 nid=0x2215 waiting for
> monitor entry [0x00002b81cbc40000]
>     java.lang.Thread.State: BLOCKED (on object monitor)
>     at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java)
>     - waiting to lock
> <0x00000006cc3066f0<http://../sequence/threadId-0x000000004da3a000_shrink-true.html#0x00000006cc3066f0_22>>
> (a bitronix.tm.resource.common.XAPool)
>     at
> bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:258)
>     at JdbcDelegate.getConnection(JdbcDelegate.java:295)
>     at JdbcDelegate.deleteJob(JdbcDelegate.java:100)
>     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:468)
>     at SimpleScheduler$RunJob$1.call(SimpleScheduler.java:465)
>     at SimpleScheduler.execTransaction(SimpleScheduler.java:223)
>     at SimpleScheduler$RunJob.call(SimpleScheduler.java:465)
>     at SimpleScheduler$RunJob.call(SimpleScheduler.java:449)
>     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>     at java.lang.Thread.run(Thread.java:662)
>
> Looking the bitronix code I find:
>
> public synchronized Object getConnectionHandle() throws Exception {
>        return getConnectionHandle(true);
>    }
>
> This method is synchronized. So, when multiple threads are working and
> beginning transaction each one will get connection handle one by one other
> will be in BLOCKED. This could be the reason of this timeout issue.
>
> Please advice.
>
> Thanks,
> Jayant
>
>
> On Fri, Oct 18, 2013 at 12:01 AM, Ludovic Orban-2 [via Bitronix Transaction
> Manager] <[hidden email]> wrote:
>
>> *> why you would say "*enlisting a resource in a timed out transaction is
>> not allowed"
>>
>> *
>> That's per JTA spec. But it's logical: allowing enlistment of a resource
>> in a timed out transaction means allowing that resource to make some work
>> that can only be rolled back. It's useless so the transaction manager
>> refuses the enlistment to prevent wasting resources.
>>
>>
>> The timeout clock starts ticking right when you call begin() and stops
>> when you call commit() or rollback(). By the way, you have to roll back
>> timed out transactions, you cannot leave them pending.
>>
>> As suggested earlier, enable debug logs and check them out. They include
>> some info about the timeout itself so they certainly can help you figuring
>> out what's going on.
>>
>>
>>
>> On Thu, Oct 17, 2013 at 8:24 PM, jayantvaish5 <[hidden email]<http://user/SendEmail.jtp?type=node&node=1558&i=0>
>>> wrote:
>>
>>> We start the transaction programatically, will debug the logs. If you can
>>> throw some light about in what scenarios this issue can come it would be
>>> very helpful.
>>>
>>>
>>> On Thu, Oct 17, 2013 at 11:46 PM, Anil Hemnani [via Bitronix Transaction
>>> Manager] <[hidden email]<http://user/SendEmail.jtp?type=node&node=1558&i=1>>
>>> wrote:
>>>
>>>> How do you start your transactions? I mean do you use UserTransaction
>>> and
>>>> start programatically or via Spring etc?
>>>>
>>>> Enable the bitronix logs and you will find more information.
>>>>
>>>> On 17 Oct 2013 19:09, "jayantvaish5" <[hidden email]<
>>> http://user/SendEmail.jtp?type=node&node=1556&i=0>>
>>>
>>>> wrote:
>>>>
>>>>> We tried increasing the timeout to 3 minutes, but we are getting this
>>>>> intermittent. Processing between begin and commit will not take such
>>> time
>>>>> as it's only one query to database where the data is also very less, we
>>>>> are
>>>>> using this for testing purpose.
>>>>>
>>>>> I think processing is still not started as the resource is not
>>> enlisted.
>>>>> So, why we are thinking of processing time between begin and commit.
>>> Am I
>>>>> right? or if not can you please tell me how the cycle goes.
>>>>>
>>>>>
>>>>> As you said:
>>>>>>> enlistInCurrentTransaction() is called because you're using a jdbc
>>>>> connection within a JTA transaction context which implies the
>>> connection's
>>>>> XA resource must be enlisted in the transaction. *Since enlisting a
>>>>>
>>>>> resource in a timed out transaction is not allowed, an exception is
>>> thrown
>>>>> with a reasonably clear error message.*
>>>>>
>>>>>
>>>>> I do not get this error message always, it's intermittent. So, why you
>>>>> would say "*enlisting a resource in a timed out transaction is not
>>>>> allowed"*
>>>>> *
>>>>> *
>>>>>
>>>>> Please help me to understand this.
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 17, 2013 at 11:23 PM, Ludovic Orban-2 [via Bitronix
>>>>> Transaction
>>>>> Manager] <[hidden email]<
>>> http://user/SendEmail.jtp?type=node&node=1556&i=1>>
>>>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> *
>>>>>>> Processing between begin and commit doesn't takes time*
>>>>>
>>>>>>
>>>>>> What makes you believe so? Can you prove it?
>>>>>>
>>>>>>
>>>>>>
>>>>>> *> if it takes time we  can increase the timeout value
>>>>>
>>>>>> *
>>>>>> Why don't you give that a try?
>>>>>>
>>>>>>
>>>>>> enlistInCurrentTransaction() is called because you're using a jdbc
>>>>>> connection within a JTA transaction context which implies the
>>>>> connection's
>>>>>> XA resource must be enlisted in the transaction. Since enlisting a
>>>>> resource
>>>>>> in a timed out transaction is not allowed, an exception is thrown
>>> with a
>>>>>> reasonably clear error message.
>>>>>>
>>>>>> Everything tends to indicate that your transaction timed out. If you
>>>>>> believe it's not the case, then you should try to collect evidences
>>>>> about
>>>>>> that and try to create a reproducible test program we could debug.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 17, 2013 at 7:32 PM, jayantvaish5 <[hidden email]<
>>>>> http://user/SendEmail.jtp?type=node&node=1554&i=0>
>>>>>
>>>>>>> wrote:
>>>>>>
>>>>>>> Hello Anil,
>>>>>>>
>>>>>>> Firstly thanks for responding to this thread.
>>>>>>> Processing between begin and commit doesn't takes time, if it takes
>>>>> time
>>>>>>> we
>>>>>>> can increase the timeout value.. But I see it's not able to enlist
>>> the
>>>>>>> connection:
>>>>>>>
>>>>>>> Caused by: bitronix.tm.internal.BitronixSystemException: transaction
>>>>> timed
>>>>>>> out
>>>>>>>        at
>>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>>>>>>> *
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Also our application is used by high number of threads which need
>>>>> multiple
>>>>>>> transaction at same time that's why we have set the pool size to
>>> high
>>>>>>> number
>>>>>>> and corresponding database is also capable to handle these number of
>>>>>>> connections.
>>>>>>>
>>>>>>> Would like to know why it would give error due to:
>>> *bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:63)
>>>>>>> *
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Jayant
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1553.html
>>>>>>>
>>>>>>> Sent from the Bitronix Transaction Manager mailing list archive at
>>>>>>> Nabble.com.
>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe from this list, please visit:
>>>>>>>
>>>>>>>    http://xircles.codehaus.org/manage_email
>>>>>>
>>>>>>
>>>>>> ------------------------------
>>>>>
>>>>>> If you reply to this email, your message will be added to the
>>>>> discussion
>>>>>> below:
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1554.html
>>>>>> To unsubscribe from Frequently getting "error enlisting a
>>>>>> JdbcConnectionHandle...", click here<
>>>>>> .
>>>>>> NAML<
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks and Regards,
>>>>> Jayant Vaish
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1555.html
>>>>>
>>>>> Sent from the Bitronix Transaction Manager mailing list archive at
>>>>> Nabble.com.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list, please visit:
>>>>>
>>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>> ------------------------------
>>>> If you reply to this email, your message will be added to the
>>> discussion
>>>> below:
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1556.html
>>>> To unsubscribe from Frequently getting "error enlisting a
>>>> JdbcConnectionHandle...", click here< > .
>>>> NAML<
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>>
>>>
>>>
>>> --
>>> Thanks and Regards,
>>> Jayant Vaish
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1557.html
>>>
>>> Sent from the Bitronix Transaction Manager mailing list archive at
>>> Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1558.html
>> To unsubscribe from Frequently getting "error enlisting a
>> JdbcConnectionHandle...", click here<
>> .
>> NAML<
http://bitronix-transaction-manager.10986.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
> --
> Thanks and Regards,
> Jayant Vaish
>
>
>
>
> --
> View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Frequently-getting-error-enlisting-a-JdbcConnectionHandle-tp1532p1559.html
> Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Frequently getting "error enlisting a JdbcConnectionHandle..."

fkovacs
This post has NOT been accepted by the mailing list yet.
This post was updated on .
One of our clients is running an application which is doing some processing for a number of items.
Each item is being processed inside a transaction.

Sometimes, the processing of the first item fails with a transaction timeout. Everything is rolled back properly.
But, the problem is that after this timeout, the processing for all the other items fails.

The application is using Bitronix, Spring and Hibernate, on an DB2 database.
We cannot reproduce the issue in our environments. Even if we force a timeout on the processing of the first item, the other are processed properly, without any issues.

Parts of the log:
25 okt 2013 at 01.04.08,141   ERROR (SessionId=2505863,org.hibernate.event.def.AbstractFlushingEventListener,301,main) []  Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert collection: [xxx#2678178]
        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.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1183)
        at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:145)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
...
Caused by: java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource XXXXXXX in state ACCESSIBLE with usage count 1 wrapping com.ibm.db2.jcc.DB2XAConnection@194a115 on com.ibm.db2.jcc.am.cf@165e33a
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:67)
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:224)
...
Caused by: bitronix.tm.internal.BitronixSystemException: transaction timed out
        at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:45)
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:65)


Then, the processing for the rest of the items fails with:
25 okt 2013 at 01.04.18,735   ERROR (SessionId=2505863,org.hibernate.event.def.AbstractFlushingEventListener,301,main) []  Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
        at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
        at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:24)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2403)
        at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)
        at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)


I'm wondering if the first timeout somehow corrupts the Bitronix resources pool, causing the rest of the processing to fail.

Any hint (even wild guess) about what is going on?

Thanks,
Florian
Loading...