• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Transaction context

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Could someone answer the following question :
Is transaction context propagated through different stateless session beans method call hierarchy. I am referring to trans-attribute.

Suppose, method X of Stateless session bean A -> calls -> method Y of Stateless session bean B, and the trans-attribute of Stateless session A is Requires and trans-attribute of Stateless session B is supports. Will the transaction context propagate from A's method to B's method ?

Any other points one should know when working with transactions and stateless session beans ?

Thanks in advance for your help!
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't matter whether the bean is session/entity/MDB, the transaction context from Required transaction attribute method to Supports transaction attribute method.

Supports - runs same as calling method transaction context.
I hope this helps
 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the bean B's method Y transaction attribute is "supports", it means if the calling method (X of A) has transaction, Y will run in caller's transacation. If the caller doesn't have transaction, then Y will run in unspecified transaction context. So, it will depends on bean B's trasaction attribute. not A's.

Hope this helps.
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic