tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Edney <neil.ed...@cmgplc.com>
Subject Life of a class?
Date Thu, 01 Mar 2001 10:00:12 GMT
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 */

    }
}


Mime
View raw message