Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HFEJB doubt

Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a question about the "bean things" that can be done at various stages in a session bean life cycle.

Ref page 216 HFEJB- if you see, we can't force transaction rollbacks or find if a transaction has been set for a rollback but we can get transaction references and call methods on them in the ejbCreate() ejbActivate() ejbPassivate and ejbRemove() methods.

The question is why is it that we can perform transaction related operations for BMT beans and not for CMT beans in these methods?

Ranch Hand
Posts: 123
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,

SPEC 7.5.7

A session bean�s newInstance, setSessionContext, ejbCreate, ejbRemove, ejbPassivate, ejbActivate, and afterCompletion methods are called with an unspecified transaction context.

So, you cannot use SessionContext methods to force transaction to complete, this is wit CMT only. In BMT you can definately get TransactionContext from SessionContext in these methods manage to your transaction programatically.


Please correct me if I am wrong.

[ August 30, 2007: Message edited by: Neo Greet ]
What's wrong? Where are you going? Stop! Read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic