@Asynchronous method VS TransactionAttribute

Moderator: admin

Post Reply
supergiu
Posts: 8
Joined: Thu Sep 25, 2014 2:48 pm
Contact:

@Asynchronous method VS TransactionAttribute

Post 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.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: @Asynchronous method VS TransactionAttribute

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests