session is already doing work in a transaction XidImpl
1117866v Oct 28, 2013 8:09 PMHello,
I am using hornetQ-core-2.2.24.jar and hornet-jms-2.2.23.final.jar on Jboss6.0.1. We have a 3 node standalone hornetQ cluster, a timer singleton bean on one of the node reads database records and generates JMS messages containing the database ID to a queue. The Queue consumer consumes these messages and runs business logic etc etc.
We have performing load test and we see loads of exceptions, I was hoping to understand from the group how and why these exceptions occur. the following exception is seen :
0:15:29,990 ERROR [org.hornetq.core.client.impl.ClientSessionImpl] (Thread-1054 (HornetQ-client-global-threads-67418210)) XA operation failed Cannot start, session is already doing work in a transaction
XidImpl (283600144 bq:0.0.0.0.0.0.0.0.0.0.-1.-1.10.-75.62.83.-82.44.63.-41.82.106.-122.91.0.5.-118.-47.0.0.0.0.0.0.0.0 formatID:131077 gtxid:0.0.0.0.0.0.0.0.0.0.-1.-1.10.-75.62.83.-82.44.63.-41.82.106.-12
2.91.0.5.-118.-49.49 base64:AAAAAAAAAAAAAP__CrU-U64sP9dSaoZbAAWK0QAAAAAAAAAAAAAAAAAAAAAAAP__CrU-U64sP9dSaoZbAAWKzzEHAgIA code:-6
If I am understanding this error right, does it mean the session is being reused ? session being not threadsafe, am I doing something wrong in configuration/code? do let me know what is needed, I will have it furnished here.
I am using the following code to fetch CF :
The timer bean uses following code to fetch a connectionfactory
String[] hostnames = {"node1", "node2", "node3"};
TransportConfiguration[] servers = new TransportConfiguration[hostnames.length];
for (int i = 0; i < servers.length; i++) {
String host = hostnames[i];
Map<String, Object> map = new HashMap<String, Object>();
map.put("host", host);
map.put("port", "5445");
TransportConfiguration server = new TransportConfiguration(NettyConnectorFactory.class.getName(), map);
servers[i] = server;
}
// Initialize a native hornetQ connection factory with knowledge of each node
HornetQConnectionFactory connectionFactory
= HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, servers);
cf = (ConnectionFactory)connectionFactory; // Cast it to the JMS interface
there after the code to get connection/session/queue/sender/ etc..
Thanks..