Page 1 of 1

@Asynchronous method VS TransactionAttribute

Posted: Thu Sep 25, 2014 3:33 pm
by supergiu
Hello,
I've just read on session bean quiz (enthuware.oce-ejbd.v6.2.407) that "The transaction context of the caller is never propagate to the target bean's asynchronous method".
So if the asynchronous method has TransactionAttribute.REQUIRED (for CMT bean, of course) and caller has its own transaction context, the container create a new transaction and the TransactionAttribute.REQUIRED behaviour become the same of TransactionAttribute.REQUIRES_NEW.
Of course for TransactionAttribute.NOT_SUPPORT and TransactionAttribute.NEVER no transaction is created for asynchronous method.
But, what is if asynchronous method is annotated with TransactionAttribute.SUPPORT and TransactionAttribute.MANDATORY and caller has its own transaction context?

I've just tryed on weblogic express (using transaction monitoring page) and TransactionAttribute works like normal method.
Is it vendor specific ?
I'm a little bit confused.
Thanks.

Re: @Asynchronous method VS TransactionAttribute

Posted: Fri Sep 26, 2014 12:18 am
by admin
In case of supports, the asynchronous method doesn't need any transaction if there is no transaction already so no new transaction is created.
In case of mandatory, the container creates a transaction anyway.

It is possible that weblogic (or any other application container) is not following the specification 100%.

HTH,
Paul.