users@glassfish.java.net

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

From: Joseph Fialli <Joseph.Fialli_at_Sun.COM>
Date: Fri, 20 Apr 2007 09:26:41 -0400

legolas wood wrote:
> Joseph Fialli wrote:
>> sankara rao bhogi wrote:
>>> Legolas Woodland wrote:
>>>> HI
>>>> Thank you for reading my post
>>>> Here is my problem, please let me know if you have any tips or advice.
>>>> We have an standalone client running on remote machines (it is not
>>>> ACC or anything link that, its a simple command line tool)
>>>> we call several web services from this client, all of these web
>>>> services are in the same glassfish application server.
>>>> one web service insert data to DB1 using connection pool and
>>>> datasource
>>>> another web service use jms server (sun mq) and send message to it .
>>>> now we want to support XA transaction between these two, do you
>>>> have any solution?
>>>> is it do-able to have XA transaction in web services?
>>>
>>> XA transactions from client to server are possible, if you are
>>> trying to invoke EJBs from the clients.
>>>
>>> WSTX supports transactions with in the web services. I have CCed Joe
>>> in this mail to clarify this specific scenario.
>> WSTX only supports flowing transaction context from the web and EJB
>> containers in glassfish v9.1.
>>
>> One can call transacted web operations from an app client, but if
>> there is a current transaction scope in the app client, a warning
>> event is logged that WSIT 1.0 does not support flowing
>> transactions from an application client container. We are
>> considering adding support for flowing transaction context from an
>> application client, but
>> we need feedback on how important this functionality is to the
>> community. If you value this functionality, I would encourage you to
>> file
>> an enhancement issue to
>> https://wsit.dev.java.net/servlets/ProjectIssues for component
>> "transaction".
>>
>
> Thank you joseph.
> By your reply i find that:
> -If we have a simple command line application ( public static void
> main() {....} ) we can not use WSIT to call two web services in a
> transaction.
This is currently an implementation limitation. It is not portable to
use UserTransaction in Java EE. It is allowed but not required.
Glassfish v9.1 was first glassfish version to support UserTransaction in
application client. We are evaluating
whether to support that functionality at this point.
> -We can call two web serviecs inside a transaction if we call them
> from a Servlet or EJB.
Yes.

See tutorial that I sent in previous email on how to enable WS-AT
transactions for a web service operation.
>
> -Web services can be servlet based or EJB based.
>
Yes. Container Managed Transaction (CMT) EJB. Also must be stateless
ejb since
only supported ejb web service is stateless at this time. (speced by Web
Services 1.2 MR Specification, maintenance release of JSR 109)
> Am I true about the above?
>
One caution. WS-Atomic Transactions have following characteristics:
- short in duration. just as JTA transactions. Durable resources
participating in the 2 phase commit typically hold locks while
    the transaction is in progress, till it is committed or rolled
back. Of course, configuration of transactional resources vary, that
   is just common case.
- all parties participating in distributed transaction trust each other
and have configured to trust each other.
   
A common use case for WS-Atomic Transaction is to enable gluing together
of heterogeneous systems with differing distributed transaction manager
systems.
Thus, these systems could still be behind a firewall and connected via
an intranet. The techonology allows distributed transaction between
a Sun Java EE application and a MS .Net 3.0 ws-at enabled web service
and/or client. It enables the integration of systems and
still being able to rely on a quality of service such as distributed
transations.

-Joe



>
>
>
>
>> -Joe Fialli, Sun Microsystems
>>
>>>
>>> regards
>>> sankar
>>>> Thanks
>>>
>>>
>>
>>
>