The class which loads the DbPool class should release it. ie. if there is no
reference to this class and the static instance is also no longer
referencing any object, I beleive the class will be ready for gc.


----- Original Message -----
From: "Neil Edney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 01, 2001 10:00 AM
Subject: Life of a class?


> Hi,
>
> We have implemented a database connection pool class (extract below) and
use
> the 'getInstance' method to ensuire that there is only one instance
created
> at any one time.
>
> What we need to know is when will this class be destroyed? Is it went the
> server is stopped (or crashed!) or will it timeout after a period of
> non-use?
>
> Regards,
> Neil
>
>
> public class DbPool extends Object implements java.io.Serializable {
>
>     private static DbPool instance;
>
>     public static DbPool getInstance(){
>         if (instance == null)
>             instance = new DbPool();
>         return instance;
>     }
>
>     /** Creates new dbPool */
>     private DbPool(){
>
>         /** dbPool code */
>
>     }
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


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

Reply via email to