Share on Google+Share on Google+

Given a list of scenarios, identify which will result in an ejbRemove method not being called on a bean instance.

Advertisement
This page discusses - Given a list of scenarios, identify which will result in an ejbRemove method not being called on a bean instance.

Given a list of scenarios, identify which will result in an ejbRemove method not being called on a bean instance.

The Bean Provider CANNOT assume that the Container will always invoke the ejbRemove() method on a session bean instance. The following scenarios result in ejbRemove() not being called on an instance:

  • A crash of the EJB Container.

  • A SYSTEM (java.lang.RuntimeException (or subclass), javax.ejb.EJBException, java.rmi.RemoteException, failure to obtain a database connection, JNDI exceptions) exception thrown from the instance’s method to the Container.

  • A TIMEOUT of client inactivity while the instance is in the passive state. The timeout is specified by the Deployer in an EJB Container implementation specific way.

If the session bean instance allocates resources in the ejbCreate<METHOD>(...) method and/or in the business methods, and normally releases the resources in the ejbRemove() method, these resources WILL NOT be automatically released in the above scenarios. The application using the session bean should provide some clean up mechanism to periodically clean up the unreleased resources.

Visit http://java.boot.by  for the updates.

Advertisements

Advertisement

Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: Given a list of scenarios, identify which will result in an ejbRemove method not being called on a bean instance.  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0