Re: Re: JOnAS/EasyBeans EJB Pool configurable?
"Hans J. Prueller" <[email protected]> Thu, 17 Feb 2011 11:46:11 +0100
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Organization | LBS logics GmbH |
| Message-ID | <1297939571.2093.46.camel@smithers> |
Florent, wie tried to implement the EJB3.1 Singleton on JOnAS 5.2M4 regarding to the example you mentioned. We now have the problem that the Annotation javax.ejb.Singleton is not available in classpath (wie have client.jar in our build path); is it required to add additional jars to classpath/build path ? regards, hans Am Mittwoch, den 09.02.2011, 14:17 +0100 schrieb Florent BENOIT: > Hi Hans, > > Yes, pool is configurable with XML or annotations > Examples here : > http://websvn.ow2.org/listing.php?repname=easybeans&path=%2Ftrunk% > 2Feasybeans%2Fexamples%2Fpool%2F > > And the other good news is that you can try EJB 3.1 Singleton feature > which is partially implemented in JOnAS 5.2 (but for your usage, > that's should be ok) > Example here : > http://websvn.ow2.org/listing.php?repname=easybeans&path=%2Ftrunk% > 2Feasybeans%2Fexamples%2Fsingleton%2F > > Regards, > > Florent > > Hans J. Prueller wrote: > > > 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 > > > >