Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide

Cache Bean-Specific Resources

Use the setMessageDrivenContext() or ejbCreate() method to cache bean specific resources, and release those resources from the ejbRemove() method.