Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C69A0D88B for ; Fri, 4 Jan 2013 22:56:36 +0000 (UTC) Received: (qmail 78139 invoked by uid 500); 4 Jan 2013 22:56:31 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 78011 invoked by uid 500); 4 Jan 2013 22:56:31 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 77999 invoked by uid 99); 4 Jan 2013 22:56:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2013 22:56:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.216.174] (HELO mail-qc0-f174.google.com) (209.85.216.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2013 22:56:25 +0000 Received: by mail-qc0-f174.google.com with SMTP id o22so9096651qcr.19 for ; Fri, 04 Jan 2013 14:56:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=W6CieX3uv38MnVL3cor6pSTFjY0Wj1yMj4HNJ4BiVCA=; b=PA/5jmwz4Aj7F3KFHY4vSp6V0N9BRJ+ZvWdHrdNL1x9udtZCaORbmqqXkLrdwmYSSO Nh5CsNLntGvbL50Tuyx4pIzwyjN5wPzs4xLxxbquV3sThPO6fIsUbXDfx9720AJH5QCP QNsjjlAgGeJwq+8h/p9a1tS5eL4MOxvIHE4NHkvlbHa4CzW2gyLoiTKMqAv4qHa490na TDxWCZ6ctf5P6+YGCb5tuQe3eCubcjo08E9hyTWh1iIlI+w5w+c/c4eiDP/gBslRUGxE lgstAEEKUyD+mFzQgPsFms6YoqxdoGc+hSsqx7uiWtxK7FWVVnYwhtT/RskVA52vX5eO 4wsg== MIME-Version: 1.0 Received: by 10.49.131.67 with SMTP id ok3mr39828049qeb.42.1357340164831; Fri, 04 Jan 2013 14:56:04 -0800 (PST) Received: by 10.229.21.79 with HTTP; Fri, 4 Jan 2013 14:56:04 -0800 (PST) In-Reply-To: <50E74BCD.8000403@christopherschultz.net> References: <50E73CEB.4090708@christopherschultz.net> <50E74901.3010101@pidster.com> <50E74BCD.8000403@christopherschultz.net> Date: Fri, 4 Jan 2013 23:56:04 +0100 Message-ID: Subject: Re: [jdbc-pool] Transaction left open by the connection validation mechanism ? From: "Davoust, Pascal" To: Tomcat Users List Content-Type: multipart/alternative; boundary=047d7bdc06f05d39a904d27e625f X-Gm-Message-State: ALoCoQkn+5VHIF4K0lZqmfy29fkl3uJkNBVUzcXYGssQ7WivK/vUEKJADsTfUUMnfgcMf9ntGBlJ X-Virus-Checked: Checked by ClamAV on apache.org --047d7bdc06f05d39a904d27e625f Content-Type: text/plain; charset=ISO-8859-1 Indeed I was referring to the tomcat jdbc-pool code, not mine :-). Now, I would suggest to consider that this problem is more common than you could imagine at first sight. First because this is randomly occuring, but frequently enough so that it shows up in quite a few areas. A few examples where this problem occurred and was filed (but not analyzed down to the root cause): Spring DataSource Txn Mgr : https://jira.springsource.org/browse/SPR-8870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel Hyperic : https://jira.hyperic.com/browse/HHQ-5054 If I'm correct, then I suggest that the behavior is corrected by default, not requiring additional configuration. Especially so that most people use the provided sample and documentation, which enables the validation mechanism. Or maybe do it the other way round, have a configuration key which allows to disable the rollback after validation... One last way would have been to test against the auto commit state of the connection to decide whether a rollback was necessary, but I believe that the pool does not maintain the connection state for performance reasons (unless an interceptor is configured to do it) and therefore would be an even more detrimental hit on performance since would require a round-trip to the db server... In any case, let me know if you need me to provide more details or to file this problem into the bug tracking system! Regards Pascal 2013/1/4 Christopher Schultz > > I think Pascal is saying that the above snippet is in the Tomcat > > JDBC code, not his. > > Whoops, I think you're right. That's a minor bug, but definitely one > that should be fixed IMO. > > Also, if the validation query succeeds and the connection is in > auto-commit mode, we may want to issue a rollback. I wouldn't want to > do that without any additional configuration, though, because it would > needlessly send ROLLBACK queries in many cases (such as other > databases - MySQL doesn't get upset when I tried a simple, similar > test - or when you don't intend to change the transaction isolation > level, etc.). > > Perhaps a configuration directive like rollBackAfterValidationQuery or > something? > > - -chris > --047d7bdc06f05d39a904d27e625f--