Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
JBossAS-4.0.0 Final
-
None
Description
SourceForge Submitter: simonpero .
In WrappedConnection.java, function close(), if there
are still opened Statements, the code goes through all
of them, and closes them.
However, in the Statement.close() function, the code
unregisters the Statement from the connection, which
changes the HashMap of statements. If you know a little
bit about Collections, needless to tell you more: the
HashMap raises a ConcurrentModificationException the
next time you call next() on the HashMap's Iterator!!!
The way to resolve this bug is easy: instead of closing a
Statement while walking the HashMap, you put all the
un-closed Statements in a List/Vector/Whatever, and
you can then safely close them in a second loop...
(Of course, this bug will never occur if one closes his
own Statements, but not everyone can code
appropriately...