• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic