user418220
user418220

Reputation: 23

Transaction Control across multiple JVMs

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?

Upvotes: 2

Views: 1720

Answers (2)

Bozho
Bozho

Reputation: 597016

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.

Upvotes: 2

Bruno
Bruno

Reputation: 122599

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

Upvotes: 1

Related Questions