Atomikos Forum |
|
Hi.
We have this situation (1)Component A consumes message 1 from queue 1 (2)Component A writes to DB (3)Component A sends message 2 to queue 1 (4)Commit Here component 2 sometime fails to read stuff written to db by component 1. Might this be due to that we have two participants in the XA transaction. AMQ and DB. First we read from AMQ, which makes it participant no 1, (and commited first). Then we write to DB, which will be participant no 2. Since we are using the same connection factory to read/write to/from amq, we will commit read/write to amq first, followed by DB. Solution? If we use separate connection factories for incoming/outgoing messages in a component, would that guarantee that the commit order would be (1)amq-in (2)db (3)amq-out If so, our problem would be solved. Cheers /Jens
Yes, that should work. Alternatively, you could send the message in a subtransaction.
Also see http://www.atomikos.com/Publications/DistributedTransactionPatterns HTH |