You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Adrian Tarau (JIRA)" <ji...@apache.org> on 2010/03/14 04:02:27 UTC

[jira] Created: (DBCP-326) Rollback an uncommited transaction on return

Rollback an uncommited transaction on return
--------------------------------------------

                 Key: DBCP-326
                 URL: https://issues.apache.org/jira/browse/DBCP-326
             Project: Commons Dbcp
          Issue Type: Improvement
    Affects Versions: 1.4, 1.3
         Environment: Any
            Reporter: Adrian Tarau
            Priority: Critical


DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.

Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.


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


[jira] Issue Comment Edited: (DBCP-326) Rollback an uncommited transaction on return

Posted by "Adrian Tarau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845659#action_12845659 ] 

Adrian Tarau edited comment on DBCP-326 at 3/16/10 2:08 AM:
------------------------------------------------------------

Not a valid request...rollback is performed already.

      was (Author: adrian.tarau):
    Not a valid request...
  
> Rollback an uncommited transaction on return
> --------------------------------------------
>
>                 Key: DBCP-326
>                 URL: https://issues.apache.org/jira/browse/DBCP-326
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.3, 1.4
>         Environment: Any
>            Reporter: Adrian Tarau
>            Priority: Critical
>
> DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.
> Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.

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


[jira] Commented: (DBCP-326) Rollback an uncommited transaction on return

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845577#action_12845577 ] 

Phil Steitz commented on DBCP-326:
----------------------------------

Yes, DBCP 1.2.2 has the same code.

> Rollback an uncommited transaction on return
> --------------------------------------------
>
>                 Key: DBCP-326
>                 URL: https://issues.apache.org/jira/browse/DBCP-326
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.3, 1.4
>         Environment: Any
>            Reporter: Adrian Tarau
>            Priority: Critical
>
> DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.
> Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.

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


[jira] Commented: (DBCP-326) Rollback an uncommited transaction on return

Posted by "Adrian Tarau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845396#action_12845396 ] 

Adrian Tarau commented on DBCP-326:
-----------------------------------

Hmm, not really but this is the only explanation that I could find for something that happened a few weeks ago.
Is this included in 1.2.x also? We used 1.2.2 until recently and honestly I'm not sure if it was 1.2.x or 1.3.x when it happened :)

> Rollback an uncommited transaction on return
> --------------------------------------------
>
>                 Key: DBCP-326
>                 URL: https://issues.apache.org/jira/browse/DBCP-326
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.3, 1.4
>         Environment: Any
>            Reporter: Adrian Tarau
>            Priority: Critical
>
> DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.
> Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.

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


[jira] Closed: (DBCP-326) Rollback an uncommited transaction on return

Posted by "Adrian Tarau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Tarau closed DBCP-326.
-----------------------------

    Resolution: Invalid

Not a valid request...

> Rollback an uncommited transaction on return
> --------------------------------------------
>
>                 Key: DBCP-326
>                 URL: https://issues.apache.org/jira/browse/DBCP-326
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.3, 1.4
>         Environment: Any
>            Reporter: Adrian Tarau
>            Priority: Critical
>
> DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.
> Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.

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


[jira] Commented: (DBCP-326) Rollback an uncommited transaction on return

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845380#action_12845380 ] 

Phil Steitz commented on DBCP-326:
----------------------------------

This *should* be current behavior.  In PoolableConnectionFactory#passivateObject, we have

{code}
public void passivateObject(Object obj) throws Exception {
        if(obj instanceof Connection) {
            Connection conn = (Connection)obj;
            if(!conn.getAutoCommit() && !conn.isReadOnly()) {
                conn.rollback();
            }
            conn.clearWarnings();
            if(!conn.getAutoCommit()) {
                conn.setAutoCommit(true);
            }
        }
        if(obj instanceof DelegatingConnection) {
            ((DelegatingConnection)obj).passivate();
        }
    }
{code}

Do you have an example where uncommitted transactions are not being rolled back?  



> Rollback an uncommited transaction on return
> --------------------------------------------
>
>                 Key: DBCP-326
>                 URL: https://issues.apache.org/jira/browse/DBCP-326
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.3, 1.4
>         Environment: Any
>            Reporter: Adrian Tarau
>            Priority: Critical
>
> DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.
> Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.

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


[jira] Commented: (DBCP-326) Rollback an uncommited transaction on return

Posted by "Adrian Tarau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845658#action_12845658 ] 

Adrian Tarau commented on DBCP-326:
-----------------------------------

Great news, that means there is a bug somewhere else.

Thanks.

> Rollback an uncommited transaction on return
> --------------------------------------------
>
>                 Key: DBCP-326
>                 URL: https://issues.apache.org/jira/browse/DBCP-326
>             Project: Commons Dbcp
>          Issue Type: Improvement
>    Affects Versions: 1.3, 1.4
>         Environment: Any
>            Reporter: Adrian Tarau
>            Priority: Critical
>
> DBCP should perform a rollback(should be configurable but by default activated) when the datasource has auto-commit=false. The reason behind is to avoid passing a partial transaction to the next client.
> Rolling back a transaction(in case it wasn't committed of course) adds a guarantee to the validity of a connection borrowed from the pool.

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