Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 94692 invoked from network); 27 Sep 2010 18:25:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Sep 2010 18:25:55 -0000 Received: (qmail 63262 invoked by uid 500); 27 Sep 2010 18:25:55 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 63241 invoked by uid 500); 27 Sep 2010 18:25:55 -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 63232 invoked by uid 99); 27 Sep 2010 18:25:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 18:25:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 18:25:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8RIPX91008217 for ; Mon, 27 Sep 2010 18:25:34 GMT Message-ID: <2785108.426031285611933908.JavaMail.jira@thor> Date: Mon, 27 Sep 2010 14:25:33 -0400 (EDT) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-268) Add Support for truncate table In-Reply-To: <699266124.1115755469806.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-268: -------------------------------- Attachment: TruncateConcurrency.java Attaching a new rev of TruncateConcurrency. The previous version was always committing the Selector after reading the first row. This version makes the commitSelector option function correctly. Now if the Selector does not commit, I see that the Truncator blocks waiting for a lock if the Truncator is working in a separate transaction. This fix does not affect the following conclusions: i) The behavior of TRUNCATE TABLE is still consistent with the SQL Standard. ii) TRUNCATE TABLE still behaves like DROP TABLE. Here are the results after fixing this defect: ------------ Re-initialization command is TRUNCATE TABLE ------------- 1) TRUNCATE TABLE command raises "Operation 'TRUNCATE TABLE' cannot be performed on object 'T' because there is an open ResultSet dependent on that object." java TruncateConcurrency truncate same sensitive java TruncateConcurrency truncate same sensitive commitTruncator java TruncateConcurrency truncate same sensitive commitSelector java TruncateConcurrency truncate same sensitive commitTruncator commitSelector java TruncateConcurrency truncate same insensitive java TruncateConcurrency truncate same insensitive commitTruncator java TruncateConcurrency truncate same insensitive commitSelector java TruncateConcurrency truncate same insensitive commitTruncator commitSelector 2) TRUNCATE TABLE command hangs waiting for a lock java TruncateConcurrency truncate different sensitive java TruncateConcurrency truncate different sensitive commitTruncator java TruncateConcurrency truncate different insensitive java TruncateConcurrency truncate different insensitive commitTruncator 3) Selector hangs trying to read the second row java TruncateConcurrency truncate different sensitive commitSelector java TruncateConcurrency truncate different insensitive commitSelector 4) Selector trips over an NPE trying to read the second row java TruncateConcurrency truncate different sensitive commitTruncator commitSelector java TruncateConcurrency truncate different insensitive commitTruncator commitSelector ------------ Re-initialization command is DROP TABLE ------------- 1') DROP TABLE raises "Operation 'DROP TABLE' cannot be performed on object 'T' because there is an open ResultSet dependent on that object." java TruncateConcurrency drop same sensitive java TruncateConcurrency drop same sensitive commitTruncator java TruncateConcurrency drop same sensitive commitSelector java TruncateConcurrency drop same sensitive commitTruncator commitSelector java TruncateConcurrency drop same insensitive java TruncateConcurrency drop same insensitive commitTruncator java TruncateConcurrency drop same insensitive commitSelector java TruncateConcurrency drop same insensitive commitTruncator commitSelector 2') DROP TABLE command hangs waiting for a lock java TruncateConcurrency drop different sensitive java TruncateConcurrency drop different sensitive commitTruncator java TruncateConcurrency drop different insensitive java TruncateConcurrency drop different insensitive commitTruncator 3') Selector hangs trying to read the second row java TruncateConcurrency drop different sensitive commitSelector java TruncateConcurrency drop different insensitive commitSelector 4') Selector trips over an NPE trying to read the second row java TruncateConcurrency drop different sensitive commitTruncator commitSelector java TruncateConcurrency drop different insensitive commitTruncator commitSelector ------------ Re-initialization command is DELETE FROM ------------- The Selector successfully reads both rows java TruncateConcurrency delete same sensitive java TruncateConcurrency delete same sensitive commitTruncator java TruncateConcurrency delete same sensitive commitSelector java TruncateConcurrency delete same sensitive commitTruncator commitSelector java TruncateConcurrency delete same insensitive java TruncateConcurrency delete same insensitive commitTruncator java TruncateConcurrency delete same insensitive commitSelector java TruncateConcurrency delete same insensitive commitTruncator commitSelector java TruncateConcurrency delete different sensitive java TruncateConcurrency delete different sensitive commitTruncator java TruncateConcurrency delete different sensitive commitSelector java TruncateConcurrency delete different sensitive commitTruncator commitSelector java TruncateConcurrency delete different insensitive java TruncateConcurrency delete different insensitive commitTruncator java TruncateConcurrency delete different insensitive commitSelector java TruncateConcurrency delete different insensitive commitTruncator commitSelector > Add Support for truncate table > ------------------------------ > > Key: DERBY-268 > URL: https://issues.apache.org/jira/browse/DERBY-268 > Project: Derby > Issue Type: Improvement > Components: SQL > Reporter: Lance Andersen > Assignee: Eranda Sooriyabandara > Priority: Minor > Attachments: derby-268-01-ab-enableForInsaneBuilds.diff, derby-268-02-aa-permsTest.diff, Derby-268.diff, tests.diff, TruncateConcurrency.java, TruncateConcurrency.java, TruncateConcurrency.java > > > Adding support for truncate table command will aid to portability -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.