• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

SessionSynchronization interface

 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB Specifications say that :
"Only a stateful Session bean with container-managed transaction demarcation may implement the SessionSynchronization interface. A stateless Session bean must not implement the SessionSynchronization interface. "
My doubt is why only stateful session beans can optionally implement SessionSynchronization interface ? Why not even Stateless bean as stateless beans too are transaction-aware ?
Thanks
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Madhu


My doubt is why only stateful session beans can optionally implement SessionSynchronization interface ? Why not even Stateless bean as stateless beans too are transaction-aware


There can be two cases of stateless beans one CMT (Container Managed Transactions) and BMT (Bean Managed Transactions)

In a stateless session bean with BMT the question of session synchronization does not arise at all as the creator of the bean has to decide when to rollback and when to commit.

Coming to stateless beans which are CMT. The stateless bean do not have a client state along with them. So if a method invocation results in a rollback or commit it has no effect on the bean state( there is no bean state!!!). so i do not have to restore the bean state in a stateless bean through the afterbegin , beforeCommit, afterCommit.

------------------

Mahindrakar
IBM Application Server Forum Moderator
Consultant - Zensar Technologies.
SCJP2 & SCJEA (Part I)
 
Madhu Juneja
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A small correction ... afterBegin() , beforeCompletion(), afterCompletion(). Thanks for the detailed information. Cleared all of my doubts.
Can you please clear one more doubt for Part I. How much knowledge of CORBA / Java IDL is required ?
Thanks.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


How much knowledge of CORBA / Java IDL is required


Rather than specific programming methods etc.. the SCJEA focusses on the CONCEPT. for example lets say if you have a legacy system in the backend. How do you connect to it. Do you have a Corba server with JAVAIDL clients etc. So do not try to focus in my opnion on Programming but when to use what. You may try out some simple corba and JAVAIDL programs(REfer JAVAIDL in the JAVA tutorial).
I myself have very little knowledge of CORBA in implemtation, just the concept.
I also did not receive many questions wherein the answers were CORBA or IDL. But maybe you may. Basically the questions contain the fact that the client is a web browser and you have to connect to a legacy system through an applet etc.

[This message has been edited by Rahul Mahindrakar (edited May 08, 2001).]
reply
    Bookmark Topic Watch Topic
  • New Topic