I've experienced loss of singleton's under heavy load.  We used an object preserver as 
detailed by Mark Grand in 'Patterns in Java' to register the singleton with a 
permanently waiting thread.

The other option is to use of statics is to specify the JVM option of -Xnoclassgc to 
stop class collection.

Regards
Richard

> -----Original Message-----
> From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 27, 2003 11:04 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Is singleton DAO acceptable? -- Best Practices
> 
> 
> Check out this link for some info about this topic. We tested 
> under WAS 5, 
> and its JDK should be 1.3.1 or something like that. Actually 
> the JDK that 
> comes which WAS 5.
> 
> http://www.javaworld.com/javaworld/javatips/jw-javatip52.html
> 
> It was curious because after a good perfomance, above certain 
> stress load, 
> singleton looks like to dissapear and app begin to throw errors.....
> 
> Can not tell you how to solve it since our solution was 
> refactoring code and 
> removing the singleton. Perhaps referencing from somewhere, 
> ServletContext 
> or a struts plugin could help. Maybe someone could help more 
> accuracily,
> 
> Adolfo.
> 
> >From: Mick Wever <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: Is singleton DAO acceptable? -- Best Practices
> >Date: Wed, 27 Aug 2003 10:43:55 +0200
> >
> >On Tue, 26 Aug 2003 20:10:07 +0000, Adolfo Miguelez wrote:
> > > Just to share my experience with singletons: under heavy 
> stress we found
> > > that a singleton class in our framework was garbage 
> collected. As far as 
> >I
> > > remember, singletons are eligible for that with current 
> SDKs despite 
> >policy
> > > has changed over times as I read from some document in the web.
> > >
> > > They were eligible for GC if its ClassLoader is GCd and 
> they are not
> > > referenced by any object... or something like that. 
> Please check for
> > > accuracy.
> >
> >This is very interesting. Which SDK implementation did you see this
> >behavour?
> >
> >The single reference to the DAO is actually inside the 
> DAOFactory not the
> >DAO itself (hence it is not a traditional Singleton) so 
> hopefully this
> >will prevent the scenerio of it being GC'd.
> >Or will I have to go further and reference it inside a 
> Struts context as
> >well? (Eg use the Struts plugin mechanism).
> >
> >Mick.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8. 
> http://join.msn.com/?page=features/junkmail
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to