commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (JIRA)" <>
Subject [jira] [Resolved] (DBCP-372) Statement Leak occurs when batch update is used.
Date Mon, 03 Feb 2014 23:21:07 GMT


Mark Thomas resolved DBCP-372.

       Resolution: Fixed
    Fix Version/s:     (was: 1.4.1)

Thanks for the report and the fix. Sorry it has taken so long to address this.

I think, based on my testing, that the statement leak has been fixed by changes to Pool but
that prior to this fix the problem manifested itself as the PreparedStatement always being
invalidated on return to the pool (making the pooling of statements pointless) if batchUpdate()
was used.

I've fixed trunk for the 2.x series the 1.5.x branch. It will be included in the next release
of each.

If there are further 1.3.x and 1.4.x releases (currently being discussed on the dev mailing
list) my expectation is that they will be generated from the 1.5.x branch so will pick up
this fix too.

> Statement Leak occurs when batch update is used.
> ------------------------------------------------
>                 Key: DBCP-372
>                 URL:
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>         Environment: Oracle 11g
>            Reporter: Naozumi Taromaru
>            Priority: Critical
>             Fix For: 1.5.1, 2.0
> org.apache.commons.dbcp.PoolablePreparedStatement#passivate()
> execute clearBatch().
> (DBCP-264)
> But this clearBatch() throw SQLException.
> (DelegatingStatement#checkOpen() throw SQLException, because _closed is true.)
> The result,
> the PoolablePreparedStatement doesn't return to pool, and
> the PoolablePreparedStatement doesn't execute PreparedStatement#close().
> When a lot of data is processed, 
> in the case of Oracle
>  * ORA-00604
>  * ORA-01000
> occurs.
> Proposal:
> "clearBatch();" in passivate() method
> changes as follows.
> batchAdded = false;
> getInnermostDelegate().clearBatch();

This message was sent by Atlassian JIRA

View raw message