views:

59

answers:

2

I have what seems to be a standard java problem: multiple database transactions, in Oracle, that need to all be committed or none. This is complicated by the fact that each process is in a seperate JVM.

The modules are connected by JMS queues in a pipeline configuration. The idea is that a series of messages can be passed through the pipeline, and when all the processing has finished a message can be sent from a coordinating module to cause all the transactions to commit.

Is it possible, with any sensible level of robustness, to synchronise commits across the multiple JVMs?

+2  A: 

When there are multiple participants in a transaction, you need some two-phase commit protocol, like XA.

When using JMS, you have an option to use JMS transactions.

And here is a comparison of the two options.

Bozho
+1  A: 

You might be interested in reading A brief history of Consensus, 2PC and Transaction Commit.

Bruno