Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 39699 invoked from network); 15 Mar 2010 15:55:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Mar 2010 15:55:38 -0000 Received: (qmail 87915 invoked by uid 500); 15 Mar 2010 15:54:50 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 87807 invoked by uid 500); 15 Mar 2010 15:54:50 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 87688 invoked by uid 99); 15 Mar 2010 15:54:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Mar 2010 15:54:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Mar 2010 15:54:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 36552234C48D for ; Mon, 15 Mar 2010 15:54:27 +0000 (UTC) Message-ID: <962285747.268171268668467221.JavaMail.jira@brutus.apache.org> Date: Mon, 15 Mar 2010 15:54:27 +0000 (UTC) From: "Phil Steitz (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (DBCP-326) Rollback an uncommited transaction on return In-Reply-To: <781642650.251231268535747240.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on 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.