You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "seenu.atluri" <se...@gmail.com> on 2015/12/14 12:48:47 UTC

Explicit transaction timeout for session bean

Hi,

I would like to explicitly set transaction timeout on stateless session bean
which is using CMT (Container Managed Transactions). I know we can set for
BMT by injecting UserTransaction/TransactionManager. Can we set it for CMT?

Please advise

Thanks & Regards,
Srinivas Atluri.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Explicit-transaction-timeout-for-session-bean-tp4677223.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Explicit transaction timeout for session bean

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You can also do the set before the container call. If not you can only
configure the global timeout (for all transactions) in tomee.xml


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-12-14 15:38 GMT+01:00 seenu.atluri <se...@gmail.com>:

> Thanks for the reply Romain.
>
> Does setting timeout through TransactionManager has effect on CMT
> transactons too? The reason why I am asking is transaction would have
> already been started by the container by the time invocation comes to the
> business method.
>
>
> Thanks & Regards,
> Srinivas Atluri.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Explicit-transaction-timeout-for-session-bean-tp4677223p4677225.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Explicit transaction timeout for session bean

Posted by "seenu.atluri" <se...@gmail.com>.
Thanks for the reply Romain. 

Does setting timeout through TransactionManager has effect on CMT
transactons too? The reason why I am asking is transaction would have
already been started by the container by the time invocation comes to the
business method.


Thanks & Regards,
Srinivas Atluri.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Explicit-transaction-timeout-for-session-bean-tp4677223p4677225.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Explicit transaction timeout for session bean

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

yes
http://docs.oracle.com/javaee/6/api/javax/transaction/TransactionManager.html#setTransactionTimeout(int)
(@Resource TransactionManager mgr; to get the tx mgr injected)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-12-14 12:48 GMT+01:00 seenu.atluri <se...@gmail.com>:

> Hi,
>
> I would like to explicitly set transaction timeout on stateless session
> bean
> which is using CMT (Container Managed Transactions). I know we can set for
> BMT by injecting UserTransaction/TransactionManager. Can we set it for CMT?
>
> Please advise
>
> Thanks & Regards,
> Srinivas Atluri.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Explicit-transaction-timeout-for-session-bean-tp4677223.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>