You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by debalguha <de...@gmail.com> on 2012/10/06 06:32:36 UTC

Using Transaction support of TOMEE

Hi
I am using TomEE to be able to leverage the JTA feature. I don't have any
EJB. I have a XA mysql data source and an XA ActiveMQ connection factory
registered in server.xml. How do I enable XA transaction between them? I
will be using them from within my servlet and declared the references in
web.xml.

Thanks



--
View this message in context: http://openejb.979440.n4.nabble.com/Using-Transaction-support-of-TOMEE-tp4657810.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Using Transaction support of TOMEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Normally it is available for injection so simply inject it into your servlet
Le 7 oct. 2012 07:15, "debalguha" <de...@gmail.com> a écrit :

> Hi Romain,
>
> Did all that you have suggested. Now in my servlet, how do I get a handle
> to
> the UserTransaction object, I have not declared/bound that to JNDI. The
> link
> http://tomee.apache.org/containers-and-resources.html does not talk
> anything
> about declaring UserTransaction as a resource.
>
> Or do you rekon, I have to create it manually inside my servlet and enlist
> the resources and programatically begin/end/commit/rollback the
> transactions?
>
> Would be great if somebody shares a small demo web app along with config
> details.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Using-Transaction-support-of-TOMEE-tp4657810p4657834.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Using Transaction support of TOMEE

Posted by debalguha <de...@gmail.com>.
Hi Romain,

Did all that you have suggested. Now in my servlet, how do I get a handle to
the UserTransaction object, I have not declared/bound that to JNDI. The link
http://tomee.apache.org/containers-and-resources.html does not talk anything
about declaring UserTransaction as a resource.

Or do you rekon, I have to create it manually inside my servlet and enlist
the resources and programatically begin/end/commit/rollback the
transactions? 

Would be great if somebody shares a small demo web app along with config
details.

Thanks



--
View this message in context: http://openejb.979440.n4.nabble.com/Using-Transaction-support-of-TOMEE-tp4657810p4657834.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Using Transaction support of TOMEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

be sure your datasource is jta and on your connection factory set the
transaction support to xa (
http://tomee.apache.org/containers-and-resources.html)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/6 debalguha <de...@gmail.com>

> Hi
> I am using TomEE to be able to leverage the JTA feature. I don't have any
> EJB. I have a XA mysql data source and an XA ActiveMQ connection factory
> registered in server.xml. How do I enable XA transaction between them? I
> will be using them from within my servlet and declared the references in
> web.xml.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Using-Transaction-support-of-TOMEE-tp4657810.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>