• Post Reply Bookmark Topic Watch Topic
  • New Topic

@Asynchronous method VS @TransactionAttribute(TransactionAttributeType....)

 
giovanni giuseppe
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I've just read on enthuware software session bean quiz (oce-ejbd.v6.2.407) that "The transaction context of the caller is never propagated to the target bean's asynchronous method".

So if the asynchronous method has @TransactionAttribute(TransactionAttributeType.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(TransactionAttributeType.REQUIRES_NEW).

Of course for @TransactionAttribute(TransactionAttributeType.NOT_SUPPORT) and @TransactionAttribute(TransactionAttributeType.NEVER) no transaction is created for asynchronous method.

But, what happen if asynchronous method is annotated with @TransactionAttribute(TransactionAttributeType.SUPPORT) and @TransactionAttribute(TransactionAttributeType.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.
 
Nandhini Sridharan
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, For Asynchronous method only REQUIRED, REQUIRES_NEW AND NOT_SUPPORTED transaction attributes are allowed.

https://docs.oracle.com/javaee/6/api/javax/ejb/TransactionAttributeType.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!