开发者

Transaction Control across multiple JVMs

开发者 https://www.devze.com 2023-01-11 01:18 出处:网络
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 pro开发者_如何学编程cess is

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 pro开发者_如何学编程cess 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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号