Hi Murali,
I'm not quite sure about Websphere, for I never used the product; but I can
guess the behavior is not much different.
As for initializing/starting threads in the startup class vs. static blocks:
For startup class, you can be absolutely sure when your threads will be
initialized/started, because for Weblogic the startup class is called after
all the beans have been deployed and all the services intialized, and just
before the server is ready for action.
Static blocks on the other hand are implemented when the first reference to
the parent class is made; the timing of this is highly unpredictable
especially in a container environment when you have dynamic class
interaction!
Hence I will only use the former UNLESS I am sure my thread and the service
it provides is stateless, or if the thread is utilized in only the class it
is contained.
Gene
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Murali, Ravipudi
Sent: Tuesday, August 01, 2000 10:45 AM
To: [EMAIL PROTECTED]
Subject: Re: threads in startup class ...
Is it like this in Websphere too?
because, I have a similar setup, where my startup classes will have a few
threads up and running,
and do callbacks on clients which register through a session bean.
The whole thing works fine in websphere test environment in VAJ, yet to
deploy it.
On a different note, is it a good idea to start my threads in a static
initializer of the class, rather than depending on the appserver to do the
start business?
Murali
-----Original Message-----
From: Gene Chuang [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 1:02 PM
To: [EMAIL PROTECTED]
Subject: Re: threads in startup class ...
Hi,
EJB spec says your BEANS cannot create new threads; however Weblogic's
startup class lies outside the realm of bean container, so its perfectly ok.
Incidentally, WL 4.5.1 and 5.1 does not have a ejbc compliance check (or
runtime check) for your beans spawning threads, so technically you can do
that as well!
Gene
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Dowd, Brian
Sent: Tuesday, August 01, 2000 4:25 AM
To: [EMAIL PROTECTED]
Subject: threads in startup class ...
HI All,
I've got a startup class which spawns a low priority thread and sleeps &
wakes up
every hour. Is this OK behaviour ? I know that one *shouldn't* create &
use threads
in WL (4.5.1), but does this apply to startup classes ??
Another option is to have an infinite loop in my startup class which
sleeps for the
time and then wakes up .... this assumes that WL instantiates & runs its
startup
classes in a separate thread ... which I don;t think it does ?
Can someone shed some light on this ????
Tanx in Advance.
Brian.
===========================================================================
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".
===========================================================================
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".
===========================================================================
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".
===========================================================================
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".