[ 
https://issues.apache.org/jira/browse/DBCP-286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695867#action_12695867
 ] 

Phil Steitz commented on DBCP-286:
----------------------------------

What jdbc driver are you using (i.e., what database and driver version?)

Where exactly are you setting automcommit on the connection?  I assume this is 
on the connection returned by the pool, not defaultAutoCommit, right?

Both 1.2.1 and 1.2.2 do the following when returning connections to the pool 
(PoolableConnectionFactory#passivate):

   if(!conn.getAutoCommit() && !conn.isReadOnly()) {
                conn.rollback();
     }

 Both set autoCommit to true (independent of defaultAutocommit setting) after 
this, but 1.2.2 tests the value first

    if(!conn.getAutoCommit()) {
        conn.setAutoCommit(true);
    }

1.2.1 always executes conn.setAutoCommit(true) without testing the value.
  
Before giving a connection to a client (PoolableConnectionFactory#activate), 
1.2.1 sets all values to the default settings directly, but 1.2.2 tests the 
values first, invoking setters only if getters return values different from the 
defaults.  These changes were to address DBCP-102.


> DBCP does not rollback
> ----------------------
>
>                 Key: DBCP-286
>                 URL: https://issues.apache.org/jira/browse/DBCP-286
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: maven, gentoo linux, any java version
>            Reporter: Trenton D. Adams
>            Priority: Blocker
>             Fix For: 1.3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> DBCP 1.2.2 does not do connection rollbacks.  Or, at least the one in maven 2 
> repositories does not.  I switched back to 1.2.1, and it works great.
> I asked about this back in 2005, and it was stated that it did.  And, it 
> does, up until 1.2.2
> http://mail-archives.apache.org/mod_mbox/commons-user/200504.mbox/<[email protected]>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to