Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 27415 invoked from network); 22 Aug 2005 19:54:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Aug 2005 19:54:42 -0000 Received: (qmail 62175 invoked by uid 500); 22 Aug 2005 19:54:40 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 62144 invoked by uid 500); 22 Aug 2005 19:54:40 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 62131 invoked by uid 99); 22 Aug 2005 19:54:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2005 12:54:40 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,SPF_HELO_FAIL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.141] (HELO e1.ny.us.ibm.com) (32.97.182.141) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2005 12:54:58 -0700 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j7MJscPx030793 for ; Mon, 22 Aug 2005 15:54:38 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j7MJscPr257160 for ; Mon, 22 Aug 2005 15:54:38 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j7MJscWA016064 for ; Mon, 22 Aug 2005 15:54:38 -0400 Received: from [127.0.0.1] (sig-9-48-122-145.mts.ibm.com [9.48.122.145]) by d01av03.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j7MJsbdk016007 for ; Mon, 22 Aug 2005 15:54:37 -0400 Message-ID: <430A2D79.6070805@sbcglobal.net> Date: Mon, 22 Aug 2005 12:54:33 -0700 From: Mike Matrigali User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: Derby 213 patch References: <668806853.1123767650948.JavaMail.jira@ajax.apache.org> <43038278.8000102@sbcglobal.net> <430A0B46.6020608@acadiau.ca> <430A22BD.4070509@acadiau.ca> In-Reply-To: <430A22BD.4070509@acadiau.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N A method that does not require looking at a lock table, it instead to test directly the behavior of what is locked. It will require 2 connections (not 2 threads), so very easy to do in java/jdbc. Something like: o set serializable o execute select statement in thread one o try to update same row in thread 2, if thread one committed then update will succeed, if not then lock will time out. To make test run faster, set default lock timeout to something small like 1 second. Be careful about depending on anything about XID's, as they are implementation specific. As you have seen they can be reused, they may jump by more than one depending on timing (background threads may use xacts also), and they may not change at all for read only transactions. Philip Wilder wrote: >> >> >>> I don't think it is so good to have references to internal classes >>> (e.g org.apache.derby.client.am.ResultSet) in the functional tests. >>> Is there a way within the public API to test if autocommit has >>> occurred, maybe the current XID from the lock table VTI would help. >>> >>> >> Initial investigations don't yield anything useful from the LockTable. >> It would seem that for the client ResultSet a lock, identical in all >> ways except for the final digit in the XID, is held both before and >> after the auto commit. This differs from the embedded behavior where >> attempting to access the lock table tells me that there are never any >> locks held for my tests. I'll continue investigating but if someone >> can prove me wrong and show how the lock table can be useful in this >> regard or offer me an alternate solution I'd be most appreciative. > > > > Sorry Kathey, I'm being dim. XIDs have the potential to work they just > require a little more creativity then my previous solution. Testing > seems to indicate that XIDs aren't held over a commit. Ergo if I compare > the XID before the commit with any XIDs after the commit and have a > match I have criteria for failing the test. > > Philip > >