"jhalliday" wrote:
https://jira.jboss.org/jira/browse/JBAS-5801
I can confirm that adding <track-connection-by-tx/> to my JMS datasource file fixed the problem.
It should look like this:
<tx-connection-factory> <jndi-name>JmsXA</jndi-name> <xa-transaction/> <rar-name>jms-ra.rar</rar-name> <!-- ADD THIS. DONT FORGET IT !!!!!!!!!!!!! --> <track-connection-by-tx/> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory>
I had the same problem which on my side was caused by accessing 2 different data-sources within the same transaction (XA transaction on Oracle database).
E.g. Method X is calling method Y which does an database A insert and calls method Z which does a database B update.
The solution was to annotate method Y and method Z with: @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
Hope this helps.