aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJBObject management 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 "EJBObject management " Watch "EJBObject management " New topic
Author

EJBObject management

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
How are EJBObjects for the various beans managed by the container?
1. Stateless session beans :
Is an EJB Object created everytime a home interface's create method is called? and Is the same EJB Object destroyed when the client calls remote interface remove() method?...Can EJBObjects be shared by clients at different times?
2. Message Driven beans:
Same questions as above.
3. Entity beans:
Same questions as above. But if the client never calls remove() method(say, he does not want the data to be deleted from the database), when does the associated EJBObject get destroyed?
4. Stateful session beans :
Let me guess. There could be a new EJBObject created and destroyed whenever client calls home interface remove() method and remote interface's remove() method. But the EJBObject still remains attached to the client, even when the bean instance has been passivated?
Sunil Patil
Greenhorn

Joined: Feb 05, 2003
Posts: 15
1. Stateless session beans :
Is an EJB Object created everytime a home interface's create method is called? and Is the same EJB Object destroyed when the client calls remote interface remove() method?...Can EJBObjects be shared by clients at different times?
In case of stateless session bean creation and removal of bean's is detached from clients create() and remove() call.Container keeps pool of beans and takes a bean out of pool only to serve a business method.
So when client calls create() a EJBObject is created and client gets stub for that EJBObject.But container attaches a bean to EJBObject only when client calls a business method.
2. Message Driven beans:
Same questions as above.
Message driven beans do not have client view so they dont have EJBObject.
3. Entity beans:
Same questions as above. But if the client never calls remove() method(say, he does not want the data to be deleted from the database), when does the associated EJBObject get destroyed?
I am confused about this. In HFEJB on some pages author says that if more than one clients are trying to access same Entity then they will share EJBObject and on other pages i can see different EJBObjects sharing same entity bean. But i guess EJBObject can not be shared.
4. Stateful session beans :
Let me guess. There could be a new EJBObject created and destroyed whenever client calls home interface remove() method and remote interface's remove() method. But the EJBObject still remains attached to the client, even when the bean instance has been passivated?
EJBObject and bean is created and removed when client calls create() and remove().
EJBObject is not passivated because what will happen if client calls business method on passivated bean.EJBObject will be there and it will tell container to activate bean.
Sunil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJBObject management