• 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

Doubt in access of tx stuff in stateless and stateful bean

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HF book on page 228 it's mentioned that

Stateless bean CAN NOT get a transaction reference and call methods on it (BMT) in ejbCreate & ejbRemove methods.

On page 196 it's mentioned that

Stateful bean CAN get a transaction reference and call methods on it (BMT) in ejbCreate & ejbRemove methods.

Is this right and if yes, then why is that difference in the behavior of Stateless vs Stateful? Also, it's mentioned that both stateful & stateless beans can't invoke setRollbackOnly & getRollbackOnly on CMT beans in ejbCreate/ejbRemove methods. Why that differentitation between BMT and CMT beans?

Please reply.

Thanks
Deep
 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deep

A stateless/stateful session bean with CMT ejbCreate, ejbRemove methods are called with an unspecified transaction context.

A stateless/stateful session bean with BMT ejbCreate, ejbRemove methods are called with a transaction context.

Please refer to Valentin Crettaz's cheat sheets:

http://www.valoxo.ch/jr/BeanLC.pdf

Thanks

-- Ravi
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic