Adapter for Enterprise JavaBeans 6.5 SP3 | webMethods Adapter for Enterprise JavaBeans Documentation | webMethods Adapter for Enterprise JavaBeans Installation and User’s Documentation | Adapter Services | Removing EJBs
 
Removing EJBs
Adapter for Enterprise Javabeans also provides a non-configurable built-in service, RemoveEJB. The RemoveEJB service is packaged with Adapter for Enterprise Javabeans and is available in the adapter's public namespace at pub.ejbadapter.removeEJB.
Note:
The RemoveEJB service is used for EJB 2.1 or earlier services only, that is for CreateEJB 2.1, InvokeEJB 2.1, and CreateInvokeEJB 2.1. For 3.0 services, as there is no home interface, the bean is automatically released by the application server.
RemoveEJB is a generic non-configurable service that takes an EJB Handle as its only parameter and invokes the EJB-standard remove() method on the EJB object represented by that handle. If successful, RemoveEJB produces no output whatsoever. If it fails, it throws an AdapterServiceException.
To control the remote EJB's life-cycle, call the RemoveEJB service from a flow service to inform the application server that a particular EJB is no longer being used by the client. This is most important when dealing with stateful or entity EJBs.
Calling the RemoveEJB service on an EJB has slightly different consequences depending upon the type of that EJB:
*For stateful session EJBs, its effect is to signal the end of the session to the application server.
*For entity EJBs, the RemoveEJB service causes the underlying entity to be removed from the EJB container. For example, CreateEJB 2.1 is used to create a new entity EJB, which may result in the application server creating a new row in a table to hold that EJB's state. Subsequently passing the Handle of that EJB to the RemoveEJB service causes the application server to delete that row from the table.
*For stateless session EJBs, it has no effect in the client. RemoveEJB simply notifies the application server that it is no longer using the EJB so that the server may, at its discretion, perform any housekeeping tasks.
The application server determines how and when the tasks above occur. If the client invokes the RemoveEJB service against an entity EJB, the client should consider that EJB to be deleted even if the application server does not actually delete the EJB at that point in time.