The problem is inside the MySQL driver.
This is from the GNU licensed MySQL driver:
    public synchronized void close() throws SQLException {
        physicalConn.close();
        physicalConn = null;
        callListener(CONNECTION_CLOSED_EVENT, null);
    }

As you can see there is no test if the physicalConn is null.
The getConnection() method has this test so I think it's a bug in the driver. I would change this method to:
public synchronized void close() throws SQLException {
if (physicalConn != null {
physicalConn.close();
}
physicalConn = null;
callListener(CONNECTION_CLOSED_EVENT, null);
}


Please report this to the MySQL people if this patch proves to be correct. (and drop a note on this list to warn other people)

To fix it you can patch the MySQL driver or ignore the NullPointer by patching KeyedCPDSConnectionFactory.destroyObject.

Another approach would be to use the jdbc1 MySQL connections and turn them into jdbc2 using the DriverAdapterCPDS (and use that one for your SharedPoolDataSource)

If you don't need the getConnection(String username, String password) method then you can always switch to the BasicDataSource if you don't want to patch and require a simple solution.

-- Dirk


Shazard wrote:
Hi There!

I am getting strange exception all the time!
It does not breaks anything but it is annoying!

As far as I found out it is because of MySQL times out it's connection
and then connecetion evictor finds that out. But it finds it out by
calling
getConnection where the exception is thrown and as result of this
exception
pool manager tries to close() connection and gets more exceptions. How should I create my MySQL based connection pool using mensioned
packages
to avoid this problem?


Please help!

Here is exception!



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



Reply via email to