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

SessionSynchronization !!

Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFEJB Pg No.513

Quote : "SessionSynchronization is for CMT beans ONLY".
Quote : "Stateless Session beans cant implement SessionSynchronization, because session beans aren't allowed to maintain a transaction once a method has enden".

But even stateful session beans using CMT, dont allow a transaction to be maintained. This feature is only available with BMT. How come then only stateful beans are allowed to use SessionSynchronization.

Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow this link.
web page
Posts: 3036
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That gave me a headache too. The first part of the statement is correct, but the "because" part is just wrong. It does make sense if you alter it:

"Stateless Session beans can't implement SessionSynchronization, because stateless session beans aren't allowed to maintain a conversational state once a method has ended."

The three SessionSynchronization methods are used to ensure the conversational state stays consistent as transactions are started, committed, and rolled back. You would expect to see them synchronize the conversational state with a database.

For Stateless Session Beans (and MDBs), this would be a waste of time, because the conversational state is meaningless once a business method returns.

For BMT Stateful Session Beans, you have control over what happens and where with the transaction, so you don't need container callbacks.

For Entity Beans, the same sort of functions are performed by ejbLoad and ejbStore.
[ January 24, 2006: Message edited by: Greg Charles ]
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic