• 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

SessionSynchronization !!

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

Thanks,
Puneet
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Follow this link.
web page
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic