就是这个函数出的错com.unitendy.dbConnection.DBConnectionManager$DBConnectionPool.release(DBConnectionManager.java:103)代码如下public synchronized void release()
        {
//System.out.println("释放连接池开始。");
for(Enumeration enumeration = freeConnections.elements(); enumeration.hasMoreElements();)
            {
                Connection connection = (Connection)enumeration.nextElement();
                try
                {
if (connection == null || connection.isClosed()){
continue;
}
if(connection!=null||!connection.isClosed())connection.close();
                    log("关闭连接池" + name + "中的一个连接");
                }
                catch(SQLException sqlexception)
                {
                    log(sqlexception, "无法关闭连接池" + name + "中的连接");
//System.out.println("释放连接池错误:");
//sqlexception.printStackTrace();
continue;//added by wangs
                }
            }
//System.out.println("释放连接池完毕。");
            freeConnections.removeAllElements();
        }

解决方案 »

  1.   

    getConnection函数public synchronized Connection getConnection()
            {
                Connection connection = null;
    //added by wangsheng 20031103
    if (freeConnections.size() >= 40)
    {
    this.release();----------------出错的地方
    checkedOut = 0;
                    //connection = newConnection();
    }
                if(freeConnections.size() > 0)
                {
                    connection = (Connection)freeConnections.firstElement();
                    freeConnections.removeElementAt(0);
                    try
                    {
                        if(connection == null || connection.isClosed())
                        {
                            log("从连接池" + name + "删除一个无效连接");
                            connection = getConnection();
                        }
                    }
                    catch(SQLException sqlexception)
                    {
                        log("从连接池" + name + "删除一个无效连接");
                        connection = getConnection();
                    }
                    log("从连接池" + name +"取一个连接");
                }
    else{
    //else if(connection == null || maxConn == 0 || checkedOut < maxConn){//modified by wangs
                    connection = newConnection();
    freeConnection(connection);
    }
                if(connection != null){
                    checkedOut++;
    }
    //System.out.println("<notify>get a connection and chekedOut from dbpool is " + checkedOut);
                return connection;
            }
      

  2.   

    你这是?释放整个连接池?从错误来看,是企图关闭已经关闭的连接
    出错的语句应该是connection.close();if(connection!=null||!connection.isClosed())connection.close();有问题,修改if(connection!=null&&!connection.isClosed())connection.close();
      

  3.   


            private Connection connOracle = null;
            public DbConnection(){
              init();
            }        /************************************************
             * openConnection
             * read file "db.properties"
            ************************************************/
            void init()
            {
                dcm = DBConnectionManager.getInstance();
                connOracle = dcm.getConnection("oracle");----------------------出错位置
            }