wood burning stoves 2.0
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
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "UnsetSessionContext & UnsetMessageDrivenContext" Watch "UnsetSessionContext & UnsetMessageDrivenContext" New topic

UnsetSessionContext & UnsetMessageDrivenContext

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
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

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?
I agree. Here's the link: http://aspose.com/file-tools
subject: UnsetSessionContext & UnsetMessageDrivenContext
It's not a secret anymore!