Bug #4808 MysqlPooledConnection.close() called twice causes NPE
Submitted: 29 Jul 2004 17:28 Modified: 29 Jul 2004 17:31
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.0.x, 3.1.x OS:NA
Assigned to: Mark Matthews CPU Architecture:Any

[29 Jul 2004 17:28] Mark Matthews
Description:
We recently got an NPE from MysqlPooledConnection.close().

    public synchronized void close()
                            throws SQLException {
        physicalConn.close();
        physicalConn = null;
    }

It appears the close() method is being called twice. I'm not yet sure what 
the cause of the NPE is, but I was wondering if this should throw an NPE. 
If so, would it be better to throw an SQLException instead of an NPE? We 
are currently using version 3.0.10 of mysql connector/j.

How to repeat:
MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();
    	ds.setURL(BaseTestCase.dbUrl);
    	PooledConnection closeMeTwice = ds.getPooledConnection();
    	closeMeTwice.close();
    	closeMeTwice.close();
[29 Jul 2004 17:31] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html