Hi!

Sanjay Nambiar wrote:
> I would like to add question to the postings on helper classes.
>
> My application uses BMP  and additionally uses some common helper classes to
> execute the functionality required.
> The helper class methods are called from with the bean.I have a lot of
> static variables which are set when the server comes up and additionally
> quite a few other applications too are running on the same server.
>
> The question is :
> If I do not access these static variables for some time,would they get
> garbage collected by the garbage collector when such a time is reached.The
> static data stored in these variables are very crucial to my application.In
> case the variables are not found my application could be in problems.

Relying on static variables, which is inherently transient information,
is not a good idea. What if you need to cluster your application? What
if the classes are indeed GC'ed due to a re-deploy?

The rules for when the static variables are reset, or rather when such a
helper class is GC'ed, are quite complex, and the answer has been
explained in detail in earlier posts (check archives), so I wont go into
detail here. I suggest that you try and find another route to solve your
problem. Have you considered using singleton RMI-objects?

/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