Hi!

Wei Jiang wrote:
> --- "Tye, Tim" <[EMAIL PROTECTED]> wrote:
> > I see a problem here...
> > The EJB specification only allows static final
> > constants or class variables.
> > Static variables cannot be set when the server
> > "comes up", they are only
> > initialized when the class is first instantiated
> > (some time later).  And,
> > when the referencing EJB is discarded by the
> > container to make room for
> > other transactions, the helper class will also be
> > discarded (and the value
> > of the static variables lost).
>
> As I remember, Java language spec 1.1 specifies that
> when a class is loaded, it will never be unloaded.
> That corrects singleton problems with language spec
> 1.0. If so, when a help "class" is discarded, it is
> the
> instance is discarded, but the static values should
> remain, at least, as long as the class loader is
> around.

That is my understanding too. The conclusion is then that static values
will be around as long as the classloader is not discarded.

The classloader is very likely to be discarded through the process of
"Hot Deployment", i.e. an upgrade of the bean during runtime. If no such
upgrade is made, it is possible (although not gien) that the use of
statics is deterministic.

/Rickard

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to