users@glassfish.java.net

Re: Transaction inside web services, what does Gklassfish provides?

From: Joseph Fialli <Joseph.Fialli_at_Sun.COM>
Date: Thu, 01 Mar 2007 14:37:40 -0500

> Hi
> Thank you for reading my post.
> we have tens of web services running inside one instance of Glassfish
> now we need to have some transaction support in several levels :
>
>
> - When we insert data into database in a single web services.
> - When we have JMS interaction in a single web service.
> - When a taransaction start from one web service and it must propagate
> inside second web service and second web service will decide whether
> it should be commited or not.
>
>
> What does Glasfish provides in this area?
> If there is no support for this kind of scenario in Glassfish, then
> what we should do?
The latest Glassfish 9.1 milestone release supports transaction
propagation over web services via WSIT transaction support of
2004 WS-Atomic Transaction/Coordination specifications.

There is introductory information on this support available from JavaOne
2006 talk at [1].
There is an early release of WSIT transaction tutorial sample available
at [2]. The tutorial sample illustrates how to write a java web/ejb
transaction client and how to write a transacted java web service.

To quickly summarize the support for transactions over web services, the
user just uses the existing Java EE JTA API.
Configuration of whether a web method is transacted or not is controlled
by WS-Atomic Transaction policy assertions.
The tutorial shows how a Java user can configure the transaction
attributes for each web service implemented
as a servlet.

Currrently, the tutorial is only illustrating a JMS resource. In
future, it will also show usage of Persistence 3.0 API/Toplink
EntityManager
within a distributed transaction and a MS .Net 3.0 client of a
transacted Java web service.

-Joe Fialli


[1] -
http://developers.sun.com/learning/javaoneonline/2006/coreenterprise/TS-1603.pdf
[slides 20-30] pointers to WS-Coordination/AtomicTransaction
specification [page 35]
[2] -
https://wsit.dev.java.net/source/browse/wsit/wsit/docs/howto/wsittutorial.zip
See wsittutorial/examples/wstx. The sample requires WSIT M3 overlayed
over latest GF milestore release[3]
       
http://java.sun.com/webservices/interop/reference/tutorial/doc/WSITTutorial.pdf
[Chatper 11 Transactions will be updated soon, instructions to run
tutorial are in zip]
[3] WSIT Milestone 3
https://jax-ws.dev.java.net/files/documents/4202/51277/wsit-1_0-fcs-bin-b07-12_feb_2007.jar