JOnAS/EasyBeans EJB Pool configurable?
"Hans J. Prueller" <[email protected]> Wed, 09 Feb 2011 09:56:12 +0100
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Organization | LBS logics GmbH |
| Message-ID | <1297241772.1840.6.camel@smithers> |
Hi, yesterday I experimented with JOnAS 5 and @PostConstruct annotation at SLSB's. As I found out, at initial access of my ear/webapp after deployment and EJB lookup/invocation; the @PostContruct-annotated Method is invoked many times, not once as I would have expected. Looking at JOnAS Admin web console, I saw that there are about "15 idle instances in the pool" after initial access. As I did something very memory consuming in the postconstruct-method (loading a very large XML document) hich is saved as a member variable of the SLSB), I reached OutOfMemoryExceptions very soon -- with 15 instances of this SLSB in the pool, the XML config was also loaded 15 times into memory. One quick workaround was to make the config-xml member of the SLSB "static" and only load it once for all instances, but this is a rather dirty hack. Is there a way to configure the EJB pool for SLSB's so that JOnAS / EasyBeans do not automatically instantiate 15 instances but only 3 or 5 or so ? Another solution would be EJB-singleton which holds the config XML, but as this is part of Java EE 6 I guess this is not available at the moment? regards, HANS