Sun Microsystems 820434310 Server User Manual


 
Cache Bean-Specic Resources
Use the setMessageDrivenContext() or ejbCreate() method to cache bean specic
resources, and release those resources from the ejbRemove() method.
Limit Use of JMS Connections
When designing an application that uses JMS connections make sure you use a methodology
that sparingly uses connections, by either pooling them or using the same connection for
multiple sessions.
The JMS connection uses two threads and the sessions use one thread each. Since these threads
are not taken from a pool and the resultant objects aren’t pooled, you could run out of memory
during periods of heavy usage.
One workaround is to move createTopicConnection into the init of the servlet.
Make sure to specically close the session, or it will stay open, which ties up resources.
EJB PerformanceTuning
SunGlassFishEnterpriseServer2.1PerformanceTuningGuide January200948