Activate and Passivate Methods in Servicing Instance Strategy.

Enterprise Java
Connection Strategies in EntityBeans

Prakash Malani
Listing 7. Activate and Passivate Methods in Servicing Instance Strategy.


public void ejbActivate () {
    super.ejbActivate();
    mConnection = ConnectionTemplate.
    obtainConnection(DATA_SOURCE_NAME);
}

public void ejbPassivate () {
    super.ejbPassivate();
    ConnectionTemplate.releaseConnection(mConnection);
}

About the Author

Prakash Malani is principal engineer at eBuilt Inc., Irvine, CA. Mr. Malani can be contacted at [email protected].