[
https://issues.apache.org/jira/browse/DBCP-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545291
]
Phil Steitz commented on DBCP-216:
----------------------------------
Modified patch applied in r598045.
To eliminate the potential for ConcurrentModificationExcepotions (which
PooledConnectionImpl was throwing), I removed the listener removal from
connection event handlers. This required refactoring to decouple listener and
pcMap cleanup from connection event handling. Cleanup is now performed in
makeObject.
Leaving issue open, since similar changes should be made for
CPDSConnectionFactory.
> Improvement of error recovery in KeyedCPDSConnectionFactory
> -----------------------------------------------------------
>
> Key: DBCP-216
> URL: https://issues.apache.org/jira/browse/DBCP-216
> Project: Commons Dbcp
> Issue Type: Improvement
> Affects Versions: 1.2.2
> Environment: Windows XP, Java 1.5.0_06-b05, Sybase ASE 12.5.4,
> jConnect 6.0.5 EBF 13862, Commons Pool 1.3
> Reporter: Marcos Sanz
> Fix For: 1.3
>
> Attachments: KeyedCPDSConnectionFactory.java.diff
>
>
> Attached you'll find a patch that improves the recovery of the class in
> different error situations.
> 1. The addition of removeConnectionEventListener() in destroyObject() ensures
> that the listener is removed, which is not guaranteed to have happened upon
> call of destroyObject(). We are for sure not interested any more in events,
> since we are about to destroy.
> 2. The same addition is made to connectionClosed(). Additionally, we have
> substituted there the call to destroyObject() with a call to
> pool.invalidateObject(). This is necessary because otherwise the object is
> destroyed but not removed from the pool.
> 3. The same substitution is made in connectionErrorOccurred(), otherwise the
> object might remain in the pool.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.