Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0DAFFDB75 for ; Fri, 17 Aug 2012 16:50:09 +0000 (UTC) Received: (qmail 86600 invoked by uid 500); 17 Aug 2012 16:50:06 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 86579 invoked by uid 500); 17 Aug 2012 16:50:06 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 86517 invoked by uid 99); 17 Aug 2012 16:50:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 16:50:06 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rick.hillegas@oracle.com designates 141.146.126.227 as permitted sender) Received: from [141.146.126.227] (HELO acsinet15.oracle.com) (141.146.126.227) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 16:49:57 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q7HGnZY2014475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Aug 2012 16:49:35 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7HGnY6m014492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 17 Aug 2012 16:49:35 GMT Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7HGnY7w029875 for ; Fri, 17 Aug 2012 11:49:34 -0500 Received: from dhcp-rmdc-twvpn-1-vpnpool-10-159-71-97.vpn.oracle.com (/10.159.71.97) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 Aug 2012 09:49:34 -0700 Message-ID: <502E7614.8060608@oracle.com> Date: Fri, 17 Aug 2012 09:49:24 -0700 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Java 7 try-with-resources (AutoClosable) on Derby connections with auto-commit off References: <501AFF61.5060901@oracle.com> <501BC91D.8050601@oracle.com> <5022786D.1000401@oracle.com> <502281EA.60908@oracle.com> <502BACB2.1040101@oracle.com> <502CEB9A.8080201@oracle.com> <502E3B3A.2090608@oracle.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsinet21.oracle.com [141.146.126.237] On 8/17/12 8:50 AM, Knut Anders Hatlen wrote: > Rick Hillegas writes: > >> Thanks for that clarification, Knut. The statement which I didn't >> understand was "I wouldn't expect that changing it would cause >> problems for existing applications". > What I meant was that existing applications written against Derby will > already have been coded so that they explicitly commit or abort the > transaction before they close the connection. This means they are not > likely to be affected by a change in how we handle closing of active > transactions. I think many applications may have addressed the problem that way. However, I think other applications may put the compensatory logic in a catch block. That may seem goofy to us, but it may make sense to someone. > ... >> If I understand this email thread correctly, there are a couple >> suggestions on the table: >> >> 1) Re-word the JDBC spec, the AutoCloseable javadoc, or Derby >> documentation. This suggestion may need some clarification. >> >> 2) Add a knob to Derby allowing applications to configure the behavior >> of Connection.close() when there is uncommitted in-flight work. The >> knob would let the application configure whether Connection.close() >> committed, rolled back, or raised an exception. The default would be >> the current behavior of raising an exception. >> >> 3) Change Connection.close() to always commit in-flight work or always >> roll back in-flight work. >> >> Do people have other suggestions? > I think the current behaviour is fine, as we essentially raise an error > to tell the application it is attempting to do something that's not well > specified and not portable. > > However, if someone feels strongly for option (3), I wouldn't object > very much, as the method would still follow the JDBC spec, the change > would be backward compatible, and the behaviour would match at least the > two other JDBC drivers I checked (MySQL and PostgreSQL). > > I remain concerned about backward compatibility and would object to option (3). Thanks, -Rick