tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Edney <>
Subject Life of a class?
Date Thu, 01 Mar 2001 10:00:12 GMT

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


public class DbPool extends Object implements {
    private static DbPool instance;
    public static DbPool getInstance(){
        if (instance == null)
            instance = new DbPool();
        return instance;
    /** Creates new dbPool */
    private DbPool(){

        /** dbPool code */


View raw message