Hello

We have hit an issue with the activemq resource adapter where a transaction
that fails (and has the rollback only flag set to true) seems to fail
subsequent messages for that thread that happen outside a transaction.

I haven't had a chance to write up a working example yet (we have
re-created it with our huge enterprise app), however the basic setup is
this:

We have a war file deployed to jboss ea, we use the jdbc and activemq
resources with XA.

BatchJobA -> runs on a schedule, inside an XA transaction.
ServiceB -> uses JMS request/reply and runs outside a transaction. in our
case it's suspended using spring @Transactional(propagation =
Propagation.NOT_SUPPORTED)
There's an issue with a db query (it returns 2 rows instead of 1) and
throws an exception. The transaction rolls back (which sets the rollback
only flag on the tx as per
https://github.com/apache/activemq/blob/main/activemq-ra/src/main/java/org/apache/activemq/ra/LocalAndXATransaction.java#L108
 )

There doesn't appear to be anything clearing this rollback only flag, and
if serviceB is the next thing to run on the same thread, then it fails
right away due to this:
https://github.com/apache/activemq/blob/9fe24cd8e3f67a7249afa32b01fc46807c5d8997/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java#L1975

We are using 5.17.0

Does this seem like a bug? Is there a safe way to reset the rollback only
flag using JTA?

Thanks for any advice,

Brock

Reply via email to