commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DBCP-286) DBCP does not rollback
Date Sun, 05 Apr 2009 15:48:12 GMT

    [ 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/<425CB254.1020504@pandora.be>

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


Mime
View raw message