This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes UnsetSessionContext & UnsetMessageDrivenContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "UnsetSessionContext & UnsetMessageDrivenContext" Watch "UnsetSessionContext & UnsetMessageDrivenContext" New topic
Author

UnsetSessionContext & UnsetMessageDrivenContext

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
We have setEntityContext and unsetEntityContext for an entity bean.
But for a session bean and a MessageDriven Bean, we have only setSessionContext and setMessageDrivenContext() method.
Can somebody explain, for a session and MessageDriven bean, why we do not have unsetSessionContext and unsetMessageDrivenContext?
Sivasundaram Umapathy
Ranch Hand

Joined: Aug 10, 2002
Posts: 360
In Session Beans and MDB's,you can always use the ejbRemove
to do the instance cleanup work where as in entity beans calling of ejbRemove means the deletion of the entity from the underlying datastore.So there must be a separate method to handle the instance cleanup.And unsetEntityContext is the place where you do that
HTH


Siva
Co-Author - SCMAD Exam Guide - ISBN:9780070077881
Author - Java certification success, Part 4: SCEA
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Dear all,
Because of Session Bean and Message Driven Bean do not have unsetSessionContext and unsetMessageDrivenContext, do we have to make those context equals "null" inside ejbRemove?
thanks
daniel
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: UnsetSessionContext & UnsetMessageDrivenContext
 
Similar Threads
why no unSetSessionContext?
unsetEntityContext and no unsetSessionContext
ejbCreate in MDB
SessionBean doesn't contain unsetEntityContext() ?
sessioncontext in EJB