Transaction Exception in HornetQ
fababril Dec 7, 2011 6:03 AMHi,
I'm having problems with hornetq and transactions in a CMT MessageDriven EJB.
After millions of insert/updates correctly transacted by the consumer I start to see this error:
10:41:59,262 ERROR [org.hornetq.core.client.impl.ClientSessionImpl] XA operation failed Cannot start, session is already doing work in a transaction XidImpl (962603696 bq:0.0.0.0.0.0.0.0.0.0.-1.-1.10.-22.58.65.0.0.18.106.78.-33.16.-13.0.0.18.121 formatID:131076 gtxid:0.0.0.0.0.0.0.0.0.0.-1.-1.10.-22.58.65.0.0.18.106.78.-33.16.-13.0.0.18.120.49 code:-6
10:41:59,263 ERROR [STDERR] javax.transaction.xa.XAException
10:41:59,263 ERROR [STDERR] at org.hornetq.core.client.impl.ClientSessionImpl.start(ClientSessionImpl.java:1454)
10:41:59,263 ERROR [STDERR] at org.hornetq.core.client.impl.DelegatingSession.start(DelegatingSession.java:501)
10:41:59,263 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:629)
10:41:59,263 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:390)
10:41:59,263 ERROR [STDERR] at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.startTransaction(MessageInflowLocalProxy.java:399)
10:41:59,263 ERROR [STDERR] at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.before(MessageInflowLocalProxy.java:235)
10:41:59,263 ERROR [STDERR] at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:135)
10:41:59,263 ERROR [STDERR] at $Proxy183.beforeDelivery(Unknown Source)
10:41:59,263 ERROR [STDERR] at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:253)
10:41:59,263 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822)
10:41:59,263 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46)
10:41:59,263 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940)
10:41:59,263 ERROR [STDERR] at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)
10:41:59,263 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
10:41:59,263 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
10:41:59,263 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
10:42:05,923 ERROR [org.hornetq.core.client.impl.ClientSessionImpl] XA operation failed Cannot start, session is already doing work in a transaction XidImpl (962603696 bq:0.0.0.0.0.0.0.0.0.0.-1.-1.10.-22.58.65.0.0.18.106.78.-33.16.-13.0.0.18.121 formatID:131076 gtxid:0.0.0.0.0.0.0.0.0.0.-1.-1.10.-22.58.65.0.0.18.106.78.-33.16.-13.0.0.18.120.49 code:-6
10:42:05,924 ERROR [STDERR] javax.transaction.xa.XAException
10:42:05,924 ERROR [STDERR] at org.hornetq.core.client.impl.ClientSessionImpl.start(ClientSessionImpl.java:1454)
10:42:05,924 ERROR [STDERR] at org.hornetq.core.client.impl.DelegatingSession.start(DelegatingSession.java:501)
10:42:05,924 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:629)
10:42:05,924 ERROR [STDERR] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:390)
10:42:05,924 ERROR [STDERR] at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.startTransaction(MessageInflowLocalProxy.java:399)
10:42:05,924 ERROR [STDERR] at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.before(MessageInflowLocalProxy.java:235)
10:42:05,924 ERROR [STDERR] at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:135)
10:42:05,924 ERROR [STDERR] at $Proxy183.beforeDelivery(Unknown Source)
10:42:05,924 ERROR [STDERR] at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:253)
10:42:05,924 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822)
10:42:05,924 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46)
10:42:05,924 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940)
10:42:05,924 ERROR [STDERR] at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)
10:42:05,924 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
10:42:05,924 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
10:42:05,924 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
It's continuos each 10 seconds, that is the blocking timeout in my datasource configuration, it shows here:
<datasources>
<local-tx-datasource>
<!-- This connection pool will be bound into JNDI with the name "java:/MySQLDB" -->
<jndi-name>DBClick</jndi-name>
<connection-url>
jdbc:mysql://localhost:3306/My_DB
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>admin</user-name>
<password>admin</password>
<transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
<!--<set-tx-query-timeout>300</set-tx-query-timeout>-->
<!--<query-timeout>300</query-timeout>-->
<!-- Don't set this any higher than max_connections on your MySQL server, usually this should be a 10 or a few 10's of connections, not hundreds or thousands -->
<min-pool-size>400</min-pool-size>
<max-pool-size>700</max-pool-size>
<!-- Don't allow connections to hang out idle too long, never longer than what wait_timeout is set to on the server...A few minutes is usually okay here, it depends on your application and how much spikey load it will see -->
<idle-timeout-minutes>2</idle-timeout-minutes>
<!-- the length of time to wait for a connection to become available when all the connections are checked out. Default is 30000 (30 seconds) -->
<blocking-timeout-millis>10000</blocking-timeout-millis>
<!-- If you're using Connector/J 3.1.8 or newer, you can use our implementation of these to increase the robustness of the connection pool. -->
<exception-sorter-class-name>
com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
<valid-connection-checker-class-name>
com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker
</valid-connection-checker-class-name>
</local-tx-datasource>
</datasources>
My jms client is a Stateless Bean that use the same connection during 500 create sessions, after that, the connection is create again.
Any Idea about my problem?
Thanks in advanced.