Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 1744 invoked from network); 25 Jul 2008 16:52:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2008 16:52:23 -0000 Received: (qmail 2523 invoked by uid 500); 25 Jul 2008 16:52:22 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 2470 invoked by uid 500); 25 Jul 2008 16:52:22 -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 2441 invoked by uid 99); 25 Jul 2008 16:52:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2008 09:52:22 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2008 16:51:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D17D2234C186 for ; Fri, 25 Jul 2008 09:51:31 -0700 (PDT) Message-ID: <850374081.1217004691857.JavaMail.jira@brutus> Date: Fri, 25 Jul 2008 09:51:31 -0700 (PDT) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3683) SYSCS_COMPRESS_TABLE gets deadlock while executing concurrently with other user threads In-Reply-To: <393413718.1211364715648.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kathey Marsden updated DERBY-3683: ---------------------------------- Component/s: SQL > SYSCS_COMPRESS_TABLE gets deadlock while executing concurrently with other user threads > --------------------------------------------------------------------------------------- > > Key: DERBY-3683 > URL: https://issues.apache.org/jira/browse/DERBY-3683 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.4.1.3 > Environment: Embedded Derby, Sun JDK 1.6.0_06-b02, Linux 2.6.9-67.0.15.EL i686 > Reporter: Juha Heljoranta > Priority: Minor > > Derby documentation about SYSCS_COMPRESS_TABLE says: "...procedure acquires an exclusive table lock on the table being compressed." However, I get: > java.sql.SQLException: The exception 'java.sql.SQLException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is: > Lock : ROW, SYSCONGLOMERATES, (7,16) > Waiting XID : {13091, X} , APP, alter table "APP"."XYZ" compress sequential > Granted XID : {13091, S} , {13087, S} > Lock : TABLE, XYZ, Tablelock > Waiting XID : {13087, IX} , APP, update XYZ set FOO = ? where BAR = ? AND ID = ? > Granted XID : {13091, X} > . The selected victim is XID : 13091.' was thrown while evaluating an expression. > if another thread is updating the same table while another thread executes: > CallableStatement cs = conn.prepareCall("CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)"); > cs.setString(1, "APP"); > cs.setString(2, "XYZ"); > cs.setShort(3, (short) 1); > cs.execute(); > conn.commit(); > Problem goes away if I acquire exclusive table lock manually right before the compress table statement: > conn.prepareStatement("LOCK TABLE XYZ IN EXCLUSIVE MODE").executeUpdate(); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.