Hi all!

I'm writing an application that uses (for now) 4 different servlets. I would
like all these servlets to share some java singelton object. Is this
possible? Do all servlets share the same jvm instance and thereby uses the
same singelton object?

I have one servlet that is set to load-on-startup, this servlet will create
the java object (db connections and other stuff) that I want all servlets to
share later on. This servlet is not used anymore, it hust listens for
shutdown and will not receive any requests. Is this how you should solve a
initialization problem or is there some other way?

When I run my application I start this servlet  (servlet1) as above. But
when I then invoke another servlet, servlet2, (that is not set to
load-on-startup) there is a strange behavior. Using my traces I can read
that it first invokes init on servlet1 again and then init on servlet2. If I
then sends a first reuquest to servlet3 it just does init on servlet3. If I
instead had sent the first request to 3 before the first request to servlet2
it is the same behavior but vice versa. when the request comes to servlet3
it does init on first 1 nd then 3. The request to servlet 2 now just incokes
init on servlet2. Have anyone a clue of you it can be like this?

// Andreas

____________________________________
Andreas Bystrom
Computer Engineer

e-horizon Streaming Technologies
Stadshusplatsen 2, 4th floor
Box 172
SE 14922 Nynashamn

mail  : [EMAIL PROTECTED]
web   : www.e-horizon.se
phone : +46 8 524 201 80
mobile: +46 708 85 23 35
____________________________________


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

Reply via email to