Issue Details (XML | Word | Printable)

Key: JDBC-250
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Chiiwen Liou
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

ConcurrentModificationException using FBConnectionPoolDataSource()

Created: 26/Apr/12 05:30 PM   Updated: 18/Aug/12 07:31 AM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.2
Fix Version/s: Jaybird 2.2

Environment: Windows XP


 Description  « Hide
Use 2.2 beta 's FBConnectionPoolDataSource() . I get ConcurrentModificationException when close a connection (jdbcConnection.close())

java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.remove(LinkedList.java:729)
at org.firebirdsql.ds.PooledConnectionHandler.closeStatements(PooledConnectionHandler.java:251)
at org.firebirdsql.ds.PooledConnectionHandler.handleClose(PooledConnectionHandler.java:161)
at org.firebirdsql.ds.PooledConnectionHandler.invoke(PooledConnectionHandler.java:109)
at $Proxy0.close(Unknown Source)


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 28/Apr/12 09:02 AM
Confirmed: missed a test for this. Workaround: Make sure you close all statements before closing the connection.

Mark Rotteveel added a comment - 28/Apr/12 09:16 AM
A statementhandler would remove itself on close, causing the ConcurrentModificationException. Changed code to make a copy of the list to iterate over.

Added two tests to cover this case: one when the connection is closed by the caller, and one where the connection is closed by the pool (eg on obtaining a new connection from the same PooledConnection.

Will review tests for classes in org.firebirdsql.ds to see if I missed other testcases.