wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes SessionSynchronization interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "SessionSynchronization interface" Watch "SessionSynchronization interface" New topic
Author

SessionSynchronization interface

Madhu Juneja
Ranch Hand

Joined: Mar 10, 2001
Posts: 176
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
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1850
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

Joined: Mar 10, 2001
Posts: 176
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

Joined: Jul 28, 2000
Posts: 1850

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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SessionSynchronization interface