Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 41639 invoked from network); 22 Feb 2006 10:06:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Feb 2006 10:06:48 -0000 Received: (qmail 11890 invoked by uid 500); 22 Feb 2006 10:06:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 11854 invoked by uid 500); 22 Feb 2006 10:06:46 -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 11844 invoked by uid 99); 22 Feb 2006 10:06:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 02:06:46 -0800 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.31] (HELO brmea-mail-1.sun.com) (192.18.98.31) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 02:06:45 -0800 Received: from phys-epost-1 ([129.159.136.14]) by brmea-mail-1.sun.com (8.12.10/8.12.9) with ESMTP id k1MA6OSD016616 for ; Wed, 22 Feb 2006 03:06:24 -0700 (MST) 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 <0IV3005012E78E@epost-mail1.sweden.sun.com> (original mail from Andreas.Korneliussen@Sun.COM) for derby-dev@db.apache.org; Wed, 22 Feb 2006 11:06:24 +0100 (MET) Received: from [129.159.112.247] (khepri35.Norway.Sun.COM [129.159.112.247]) by epost-mail1.sweden.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTPA id <0IV300M5D2QNGL@epost-mail1.sweden.sun.com> for derby-dev@db.apache.org; Wed, 22 Feb 2006 11:06:24 +0100 (MET) Date: Wed, 22 Feb 2006 11:06:23 +0100 From: Andreas Korneliussen Subject: Re: conflict detection strategies In-reply-to: <43F347C7.4040501@sun.com> To: Andreas.Korneliussen@Sun.COM Cc: derby-dev@db.apache.org Reply-to: Andreas.Korneliussen@Sun.COM Message-id: <43FC379F.8080301@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 1.0.7 (X11/20050930) References: <43F1BEF6.6020301@sun.com> <43F3388A.9060500@apache.org> <43F347C7.4040501@sun.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Andreas Korneliussen wrote: > Daniel John Debrunner wrote: > >> Andreas Korneliussen wrote: >> >> >>> Problem: >>> For holdable cursors, we will release the table intent lock when doing >>> commit on the transaction for the cursor. >>> >>> The table intent lock, prevents the system from doing a compress of the >>> table, causing all RowLocations to be invalid. In addition, it prevents >>> reuse of RowLocation for deleted + purged rows. >> >> >> >> I think this last paragraph is an incorrect assuption. The table intent >> lock prevents other transactions from doing a compress, but not the >> transaction holding the lock. >> > It seems to me that that online compress will not use the same transaction: ij> autocommit off; ij> get cursor c1 as 'select * from t1 for update'; ij> call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP','T1', 1, 1, 1); ERROR 40XL1: A lock could not be obtained within the time requested ij> rollback; Offline compress is rejected if executed from the same connection: ij> get cursor c1 as 'select * from t1 for update'; ij> next c1; ID ----------- 1 ij> call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'T1', 0); ERROR 38000: The exception 'SQL Exception: Operation 'ALTER TABLE' cannot be performed on object 'T1' because there is an open ResultSet dependent on that object.' was thrown while evaluating an expression. ERROR X0X95: Operation 'ALTER TABLE' cannot be performed on object 'T1' because there is an open ResultSet dependent on that object. ij> Are there other user-visible mechanisms to start online compress ? If not, I think we could conclude that there are no known issues with the use of RowLocation in non-holdable SUR (given the discussions about validity of RowLocation in separate threads) Andreas > That is a good point. > > The main problem would be the system doing a compress, however we should > take into account the fact that the user can run compress from the same > transaction, and then maybe invalidate the resultset, or prevent the > compress from running. > >> I think there are other situations where the RowLocation will become >> invalid, such as the transaction deleteing the row. >> > > Yes, however as far as I understood, the RowLocation would not be reused > as long as at least some sort of table level intent lock is held, and > the store will simply return false if one tries to do update / delete / > fetch on a RowLocation which is deleted, or deleted+purged. > > Andreas