ops4j / org.ops4j.pax.transx

Transaction Manager and JMS / JDBC pooling support
Apache License 2.0
9 stars 7 forks source link

Multi transaction manager support #67

Closed Maurice-Betzel closed 2 years ago

Maurice-Betzel commented 2 years ago

Due to no other way of asking, and I can guess what the answer will be. Does pax-transx support multiple TM like for distributed transactions? Or is there another way for coordination of a 2 phase commit across multiple jvm’s?

grgrzybek commented 2 years ago

I've never run multiprocess TX/XA manager. However Pax Transx is a wrapper using different TX managers including Narayana and Atomikos and afaik, these support distributed transactions. Pax Transx allows you to configure them, but I didn't even check how it can be done...

Maurice-Betzel commented 2 years ago

And again I was not clear enough. An example, I have a VM running pax JDBC and Transx and another VM running pax JMS and Transx. Could it be possible to coordinate a 2 phase transaction, pulling of a queue on the JMS VM and commit into a DB on the other VM? Is the OSGi coordinator a way to do this?

grgrzybek commented 2 years ago

Hmm. What you want to coordinate is a set of XA resources. Database accessed via JDBC and queue manager accessed via JMS are such resources. Pax JDBC or Pax JMS themselves are not.

Correct me if I'm wrong, but here's what I understand:

The "some VM" I mentioned (where you have access to JMS and JDBC connection can be one VM - and this is where JTA/XA transactions come into play.

A scenario where you get a message (using JMS connection on VM1 to access queue manager on VM2) and invoke a remote server (REST/SOAP) on, say, VM3 where you write do DB (using JDBC connection on VM3 to access database on VM4) is more complex scenario and involves (afaik) distributed transaction management (not just XA transaction manager running on single VM) and (afaik) Corba OTS service.

I'm pretty sure that Narayana IS distributed transaction manager, I've just never used in such way with Pax Transx.

Maurice-Betzel commented 2 years ago

OK, thx. I will look into Narayana.