commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DBCP-351) setAutoCommit called too many times
Date Fri, 14 Feb 2014 11:49:20 GMT

     [ https://issues.apache.org/jira/browse/DBCP-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Thomas resolved DBCP-351.
------------------------------

    Resolution: Fixed

New option enableAutoCommitOnReturn added.

> setAutoCommit called too many times
> -----------------------------------
>
>                 Key: DBCP-351
>                 URL: https://issues.apache.org/jira/browse/DBCP-351
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: OD
>             Fix For: 2.0
>
>
> 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 was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message