Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 40085 invoked from network); 8 Apr 2007 17:52:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2007 17:52:45 -0000 Received: (qmail 10244 invoked by uid 500); 8 Apr 2007 17:52:52 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 10233 invoked by uid 99); 8 Apr 2007 17:52:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2007 10:52:52 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [216.148.213.132] (HELO smtp.mailix.net) (216.148.213.132) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2007 10:52:45 -0700 Received: from [192.168.8.8] (helo=localhost) by smtp.mailix.net with asmtp (Exim 4.24-CA) id 1HabYq-0006Qr-RX; Sun, 08 Apr 2007 10:52:20 -0700 Received: from 137.94-242-81.adsl-dyn.isp.belgacom.be (137.94-242-81.adsl-dyn.isp.belgacom.be [81.242.94.137]) by webmail.jpox.org (IMP) with HTTP for ; Sun, 8 Apr 2007 10:52:20 -0700 Message-ID: <1176054740.46192bd4c4de3@webmail.jpox.org> Date: Sun, 8 Apr 2007 10:52:20 -0700 From: Erik Bengtson To: Apache JDO project , JDO Expert Group References: <1176039606.4618f0b60df35@webmail.jpox.org> <1176047251.46190e9347503@webmail.jpox.org> <93C042FD-A943-4D4C-9122-8EA3A98F46BB@SUN.com> In-Reply-To: <93C042FD-A943-4D4C-9122-8EA3A98F46BB@SUN.com> MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) 3.2.3 X-Originating-IP: 81.242.94.137 X-SA-Exim-Mail-From: erik@jpox.org Subject: Re: DatastoreConnection / optimistic txs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-SA-Exim-Version: 3.1 (built Thu Oct 23 13:26:47 PDT 2003) X-SA-Exim-Scanned: No; Unknown failure X-uvscan-result: clean (1HabYq-0006Qr-RX) X-Virus-Checked: Checked by ClamAV on apache.org > I'm afraid I don't know what you mean by "this feature" and "this > change". If you want to guarantee that the datastore connection you > get is enlisted in the JDO transaction tx.setOptimistic(true) tx.begin() //do some operations here JDOConnection conn = tx.getDataStoreConnection(); conn.getNativeConnection().execute("UPDATE TABLEB SET A=1"); conn.close(); tx.rollback(); A flush may or may not be performed before "getDataStoreConnection" gets invoked. If a flush is performed, the connection is enlisted in the transaction. So, accessing the datastore connection and doing updates is not portable, since the connection may or may not be enlisted in the transaction. The side effect of my change proposal would make it portable since connections are always enlisted in the transaction :) > we can add a flag to guarantee it. I'm in favor of breaking backward compatibility and not adding a new flag, because currently it's not ACID neither portable.