From derby-dev-return-9525-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Fri Oct 21 12:09:51 2005 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 31974 invoked from network); 21 Oct 2005 12:09:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Oct 2005 12:09:50 -0000 Received: (qmail 31480 invoked by uid 500); 21 Oct 2005 12:09:49 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 31235 invoked by uid 500); 21 Oct 2005 12:09:48 -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 31226 invoked by uid 99); 21 Oct 2005 12:09:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2005 05:09:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.36] (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2005 05:09:47 -0700 Received: from phys-epost-1 ([129.159.136.14]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j9LC9QeT005868 for ; Fri, 21 Oct 2005 06:09:26 -0600 (MDT) Received: from conversion-daemon.epost-mail1.sweden.sun.com by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IOP00B01LMPJV@epost-mail1.sweden.sun.com> (original mail from Andreas.Korneliussen@Sun.COM) for derby-dev@db.apache.org; Fri, 21 Oct 2005 14:09:25 +0200 (MEST) Received: from [129.159.112.205] (atum05.Norway.Sun.COM [129.159.112.205]) by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTPA id <0IOP000V5LRP2R@epost-mail1.sweden.sun.com> for derby-dev@db.apache.org; Fri, 21 Oct 2005 14:09:25 +0200 (MEST) Date: Fri, 21 Oct 2005 14:09:24 +0200 From: Andreas Korneliussen Subject: Re: Question about setTransactionIsolation in network client driver In-reply-to: <58ed70f50510201817h1a755a0s6405a36b76f3ebb9@mail.gmail.com> To: derby-dev@db.apache.org Reply-to: Andreas.Korneliussen@Sun.COM Message-id: <4358DA74.9060406@sun.com> Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) References: <58ed70f50510201817h1a755a0s6405a36b76f3ebb9@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Deepa Remesh wrote: > When autocommit is set to false, a call to setTransactionIsolation > using client driver does not end the transaction when the method > exits. When a close() is called on the conection, it throws an > exception. > > Running the code below: > > conn.setAutoCommit(false); > conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); > try{ > conn.close(); > }catch(SQLException se){ > System.out.println("Got exception when closing the connection"); > se.printStackTrace(); > } > > with client driver gives: > Got exception when closing the connection > org.apache.derby.client.am.SqlException: java.sql.Connection.close() > requested while a transaction is in progress on the connection.The > transaction remains active, and the connection cannot be closed. > > with embedded driver, it works okay and does not throw any exception. > > This looks like a bug to me. Can someone please confirm? If I don't > hear otherwise, I'll open a JIRA issue tommorow. > > Thanks Kathey for bringing this up. > Hi, Yes, this looks like a bug in the client driver. A call to setTransactionIsolation() should cause the current transaction to commit. Andreas > Thanks, > Deepa