users@glassfish.java.net

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

From: Legolas Woodland <legolas.w_at_gmail.com>
Date: Wed, 18 Apr 2007 15:54:21 +0330

Please read inline

On 4/18/07, sankara rao bhogi <Sankara.Rao_at_sun.com> wrote:

> Legolas Woodland wrote:
> > Hi
> > Thank you very much.
> > to explain more:
> > We have our web services in a web application which is deployed into
> > glasfish application server.
> > so our web services are based on servlet if i am not mistaken.
> > What i look to do is like:
> > -lookup into application server using initialcontext and ..
> > -retreive a user transaction from the JNDI?
> > -start user transaction before invoking first web service
> > -commit user transaction after calling second web service.
> >
>
> I suspect it wouldn't work for web services. The work in web services
> wouldn't be part of the transactional scope of the client. It will work
> if you replace the calls to webservices with EJB method calls, assuming
> one of the Required, RequiresNew, Supports attributes are specified.


What if i do something like the following:

All of our services/servlets are in the same application server whether
clustered or single instance.

-We have a servlet or a web service running inside our server
-This we servlet or web service call two other web services which are inside
the same
application server
-can we create a transaction which will include this two calls?

we can not move to any kind of ejbs for now, i know that we can use
stateless session beans to create web services but it is not our case now.

What does UserTransaction do if it can not handle a case like this?


Thanks



> > I know that Enterprise pack support ws-tx but in our case we call all
> > web services using DDI and we do not use enterprise pack to develop
> > web services clients.
> > Thanks
> >
> > On 4/18/07, *sankara rao bhogi* <Sankara.Rao_at_sun.com
> > <mailto:Sankara.Rao_at_sun.com>> 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.
> >
> > regards
> > sankar
> > > Thanks
> >
> >
> > --
> > "The best insurance for tomorrow is the effective use of today."
> > -- Why Smart People Do Dumb Things by Dr. Mortimer Feinberg and John
> >
> >
>
>
> --
> "The best insurance for tomorrow is the effective use of today."
> -- Why Smart People Do Dumb Things by Dr. Mortimer Feinberg and John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>