commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Commented: (DBCP-351) setAutoCommit called too many times
Date Tue, 01 Feb 2011 15:34:28 GMT


Phil Steitz commented on DBCP-351:

See DBCP-97 and DBCP-102, especially the comment by Dain in DBCP-97.  We can discuss changing
the implementation, but I tend to agree with Dain that it is better for passivate to prevent
idle connections from holding open database transactions.  Given the back-and-forth on this,
it might be best to make the behavior configurable.  Anyone have any better ideas?

> setAutoCommit called too many times
> -----------------------------------
>                 Key: DBCP-351
>                 URL:
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: OD
> passivateObject in PoolableConnectionFactory sets autoCommit to true, even if defaultAutoCommit
is set to false. This results in two extra db queries for every use of the connection (set
false, do work, set true). This creates a significant amount of overhead, even if the connection
is never even used.
> I propose it be changed to:
> if(conn.getAutoCommit() != _defaultAutoCommit)
> {
>   conn.setAutoCommit(_defaultAutoCommit);
> }

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message