Dec 7th, 2006, 06:28 AM
Transaction propogation support with Hessian/Burlap/HTTPInvoker
Does RPC protocols like Hessian/Burlap/HttpInvoker supports transaction propogation?
Any example/sample will be really a great help.
The scenario can be:
A gui client/java client calls ejb. This ejb commits to database and calls a hessian service which in turn calls an ejb that commits to database.
Thanks in Advance
Dec 7th, 2006, 10:45 AM
No, transaction propagation is only implemented in RMI-IIOP.
Dec 7th, 2006, 12:40 PM
What stops me from adding a Jta transaction manager to the service calls (or the EJB which is used by it)? If everything is in the same app server, then it should co-ordinate the transaction.
Dec 7th, 2006, 01:23 PM
Well, if you're using Hessian/Burlap to expose your services I assume they're not in the same server. Even if they're, tx coordination will not work because the underlying protocol doesn't provide that feature.
If they're, in fact, in the same server I guess it should also expose an ejb local interface to achieve the desired coordination.
Dec 7th, 2006, 10:32 PM
Below is text from hessian spec.
Headers are (string, object) pairs that preceed the arguments.
The value of the header can be any serialized object.
For example, a request might include a transaction context in a header.
Call with Distributed Transaction Context c x01 x00
H x00 x0b transaction
r t x00 x28 com.caucho.hessian.xa.TransactionManager
S x00 x23 http://hostname/xa?ejbid=01b8e19a77
m x00 x05 debug
I x00 x03 x01 xcb
Also, if you read the hessian design goals, one of the goal was the support for transaction.
When they say, they support transactions, it is hard to believe that it cannot be achieved using spring....
Any taker of this challenge...
Dec 8th, 2006, 02:35 AM
You also need a JTA XA transaction manager that's capable of distributed transactions on the side that initializes the transaction. Not all JTA XA transaction managers support it (JBoss has no support for it - maybe 4.0.5 or 5.0.0 support it, not sure).
If you are doing ejb<->ejb communication why do you need hessian?
Edit: if we are talking about one single server, yes it should work, but then you need no remoting at all.
Dec 11th, 2006, 11:55 AM
As you say it's listed in the design goals, however I haven't ever seen a working example or even a reference of that. (I didn't make an exhaustive research though).
Originally Posted by sp_ojha
There's no reference of that even in the spring docs (http://www.springframework.org/docs/.../remoting.html), section 17.8
Maybe you're right and it works, but nobody tried it yet.
dejanp: Why should it work in a single server? Are you assuming everything happens in the same thread? Isn't transaction information lost in such a call?