----- Original Message -----
From: Kevin A. Burton <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 24, 2000 7:27 PM
Subject: JDK 1.1 Garbage Collects all singletons.
<snip>
>
> Basically singletons don't work. Both VMs will GC static members right
> after there are no references. For Servlet code that can happen very
> quickly. With finalize methods you can clearly see this happening.
>
> Everythign works just fine with the Singleton. But when the you access
> the Singleton again it is re-instantiated for you by the VM. Totally
> getting rid of the advantage of a singleton.
>
I always thought the purpose of a Singleton is not so much to stay cached in
memory but to disallow multiple instances of its-self to ever be
instantiated at any point in time. What this buys you is that, say you have
multiple concurrent users all using trying to use the same object, the
Singleton pattern will make sure that they all share the same instance
instead of a new instance for each user. Does this make since or am I way
off here?
-Scott-
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]