Atomikos Forum

XA commit ordering. Problem and solution?

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
Jens Ohlsson Send private email
Monday, November 11, 2013
 
 
Yes, that should work. Alternatively, you could send the message in a subtransaction.

Also see http://www.atomikos.com/Publications/DistributedTransactionPatterns

HTH
Guy Pardon Send private email
Sunday, December 08, 2013
 
 
By the way, this is not the first time I have seen this question pop up.

@Jens: Any suggestions where to document it? Where would you be looking for a solution? Where were you looking before posting here?

Thanks for helping us improve our docs!!!
Guy Pardon Send private email
Sunday, December 08, 2013
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics