Atomikos Forum |
|
Hello,
I have a java main program configured with a Spring DefaultMessageListenerContainer and Atomikos TransactionEssentials v3.8.0 for XA between MySql v5.x and IBM MQSeries v1.7.1.x. Basically it receives messages on a queue via Spring MDP and then save it into a database plus sends to another queue (hence XA). So it is an XA transaction that involves a read (from an input queue), write (to MySql DB) and write (to an output queue). We have noticed that when MySql is having issue (assume table lock or some connection issues) and when the XA transaction hits the transaction timeout (in my case it is 5 minutes) the transaction is not rolled back cleanly! And the incoming message/data is consumed (or lost) without fully completing the transaction! I see this warning in the logs: trying to recover. Cause: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: Prepare: NO vote I know the common answer mentioned in the forum is to increase the timeout to a larger value. We can do that. However I would like to know if there is a way to have this warning thrown an error or an exception? If you need more details, I can provide it. Thanks, Abdul
My bad. The message is NOT getting lost. The message is rolling back cleanly as it should. Kudos to atomikos. The problem was in my code, specific to the way we handle the messages and how we consume and ignore messages sometimes. Still I hope there is a way for atomikos (or me to configure) to throw an system/runtime exception rather than printing mere WARNINGs on messages that causes the rollback for whatever reason. Because I would like to be alerted when the transaction is rolled back.
|