users@glassfish.java.net

Re: Start a transaction from client and propagate it to server

From: <glassfish_at_javadesktop.org>
Date: Thu, 19 Apr 2007 14:32:18 PDT

Hi,

Just a side note since in a previous post you mentioned using JNDI lookup to get a UserTransaction, but in Java EE 5 containers such as GlassFish you dont have to use JNDI to lookup resources such as UserTransaction, you can use annotations and dependency injection(new features in GlassfIsh) and in your code just do this

@Resource UserTransaction utx;

and you can save yourself from cutting/pasting the same JNDI lookup code everywhere. Its a nice new feature and makes code a bit cleaner.

>So, using one endpoint to handle transaction issue is not a solution for us.
>You have mentioned WS-* like WS-TX and other standards, can you please
>let me know where i can find information about using glassfish and this
>standards?
I think the tango link send in previous post would help you if you want to use some of the web service extensions and try out those techniques.

In general, this is the current programming model with web services. SOAP protocol does not have transactions as part of its core features. Transactions on the web are not the primary useage of the standard UserTransaction and other distributed transaction management technologies. RMI-IIOP calls are used for these tighter types of integration, like a method call that accesses two different transactional resources and the transaction across those two resources can be handled by a transaction manager. With RMI-IIOP lots of things can be propogated along a chain of method invocations to different components. You cant just extend that to the web programming model to the internet. You have to look at WS-*, or modify your app design.

hth,
Sean
[Message sent by forum member 'sean_brydon' (sean_brydon)]

http://forums.java.net/jive/thread.jspa?messageID=213271