Bug #1029 calling .close() on idle connection generates exception
Submitted: 11 Aug 2003 8:34 Modified: 11 Aug 2003 8:46
Reporter: Jason Jakob Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.1.0-alpha OS:W2000
Assigned to: CPU Architecture:Any

[11 Aug 2003 8:34] Jason Jakob
Description:

java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
        at java.util.HashMap$KeyIterator.next(HashMap.java:798)
        at com.mysql.jdbc.Connection.closeAllOpenStatements(Connection.java:2538
)
        at com.mysql.jdbc.Connection.close(Connection.java:1067)
        at com.eltech.jdbc.DBConnection.destroy(DBConnection.java:169)
        at com.eltech.jdbc.DBConnection.closeConnection(DBConnection.java:296)
        at com.eltech.jdbc.DBConnectionPool.closeAll(DBConnectionPool.java:128)
        at com.eltech.jdbc.DBConnectionPool.finalize(DBConnectionPool.java:420)
        at Q931Daemon.destroyDBConnectionPool(Q931Daemon.java:413)
        at Q931Daemon.execute(Q931Daemon.java:406)
        at Q931Daemon.access$000(Q931Daemon.java:17)
        at Q931Daemon$RefreshTask.run(Q931Daemon.java:140)
        at java.util.TimerThread.mainLoop(Timer.java:432)
        at java.util.TimerThread.run(Timer.java:382)

How to repeat:
open a connection.
create a statement
run the query
do not close the statement
close the connection.

Suggested fix:
I guess there is something wrong in the funtion:

com.mysql.jdbc.Connection.closeAllOpenStatements

Jason J.
[11 Aug 2003 8:46] 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

This is a known bug which has been fixed for quite some time, but not released yet (Connector/J releases are currently dependent on MySQL-4.1.1 being released). See http://mmmysql.sourceforge.net/snapshots/dev/ for a build with the fix.

Thanks for your bug report!

  -Mark