Cross-context Transaction

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross-context Transaction

oliosien
I have a question, Is it possible use Bitronix Tx Manager to manage a transaction
which is shared by different application?

For example:

I have an application (I call it A) which insert a value in a table T in a database D, and
then this application invoke a service (a second application - I call it B) which have to
insert a second value in a table T1 in the same database D.
This work have to be done by an unique transaction, so the application A and the
application B have to share the same transaction so if the operation called by B
doesn't work the transaction (rollback) doesn't change table T.

Is it possible do this work using Bitronix?

Thanks a lot,

Enrico
Reply | Threaded
Open this post in threaded view
|

Re: Cross-context Transaction

Ludovic Orban
Administrator
Hi,

I guess you're speaking about transactional context propagation across virtual machines.

There are basically two standard ways to do that in Java: WS-AT for web services and JTS for CORBA/RMI. Unfortunately both are outside the BTM project's scope and aren't implemented: BTM can only manage transactions inside a single virtual machine.

Sorry,
Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: Cross-context Transaction

oliosien
Thanks a lot for your answer Ludovic.
All my applications have been done using spring framework, and using http invoker service
(spring offers this possibility).

Do you know if WS-AT is better than JTS with Spring (or viceversa) or if there is a better way
to use transactional context propagation with Spring?


Enrico

Ludovic Orban wrote
Hi,

I guess you're speaking about transactional context propagation across virtual machines.

There are basically two standard ways to do that in Java: WS-AT for web services and JTS for CORBA/RMI. Unfortunately both are outside the BTM project's scope and aren't implemented: BTM can only manage transactions inside a single virtual machine.

Sorry,
Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: Cross-context Transaction

Ludovic Orban
Administrator
Both JTS and WS-AT are complex to set up even with the help of Spring. The first one works with RMI over IIOP while the latter works with JAX-WS and Web Services. There are alternatives to these two protocols but they are proprietary (like the JBoss Transactional support for JAX RS or Atomikos' Web Services Transactional context propagation protocol).

As far as I can tell you will in all cases need to change the remoting protocol you configured in Spring to replace it with one which supports transactional context propagation. In clear, the Spring 'http invoker' cannot do that and from the supported list of remoting protocols (here: http://static.springsource.org/spring/docs/2.5.x/reference/remoting.html) your best bet is either RMI or JAX-WS IMHO.

I would first advise you to change the remoting protocol to one of these two, pick the one that best matches your needs and get it running without transactional context propagation first. Then find a working TM that can do that propagation. My personal preference goes to Atomikos Extreme Transactions as I find it much more practical than most of its competitors and nearly is a drop-in replacement to BTM.

Keep in mind that there is no open source solution which can do that in a truly reliable way that I'm aware of so be prepared to pay for the license cost.

Good luck,
Ludovic