Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 62027 invoked from network); 11 Sep 2007 17:55:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2007 17:55:57 -0000 Received: (qmail 22485 invoked by uid 500); 11 Sep 2007 17:55:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 22456 invoked by uid 500); 11 Sep 2007 17:55: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 22447 invoked by uid 99); 11 Sep 2007 17:55:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2007 10:55:46 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paulschein@gmail.com designates 209.85.132.244 as permitted sender) Received: from [209.85.132.244] (HELO an-out-0708.google.com) (209.85.132.244) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2007 17:55:44 +0000 Received: by an-out-0708.google.com with SMTP id c8so290566ana for ; Tue, 11 Sep 2007 10:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=rPGsEAhjUJpffjHrC+v+6ZPiK4V5zraHFyn6q3Oq13A=; b=Rg2tlxQrpGQ+J0+uMjGOC9nWmVS4Tmu/OL0/uYk/Y07RLB72p+RlYuGUVdQANH6cv9CdINTKxhv1LangBHHcGUs+1cl0lRe4rWgQAfHP1Umk6f8Jccdkc8v5yjW6A1gxSZVmhZdDs1m0wr58KkXyJeBAhXUUFaj7VWmf8N/zQpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=TEsNj9QYfTWyC9qjG5SLZbpuy3lSwW26WbJ9eT29XwztPYaEmM4Hmhh0qk78rRhjJyWCzX2lO//GOp/a8lGYkFcYY/8iz7QL4n63EE4WVd2woXA6slVLNYEi+6IVlqTcokRfxXCIbmO6jAT/NW/a3TolKNhH8PKPMOOeIKz8AOc= Received: by 10.100.121.12 with SMTP id t12mr6880140anc.1189533323701; Tue, 11 Sep 2007 10:55:23 -0700 (PDT) Received: by 10.64.47.11 with HTTP; Tue, 11 Sep 2007 10:55:23 -0700 (PDT) Message-ID: Date: Tue, 11 Sep 2007 18:55:23 +0100 From: "Paulo Jesus" To: Derby-Dev Subject: Need help to understand transactions context and aborting transactions on commit stage. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org I'm developing a feature on derby engine that needs to abort transactions on committing stage. I'm working on Derby v10.2.2.0, the main project was not ported yet to v10.3. Transactions are being forced to abort in two more places, on waiting by not granted lock and just before execution of a prepared statement. I found that abort transactions on commit without careful leads to exception java.lang.ArrayIndexOutOfBoundsException at java.util.ArrayList.remove(ArrayList.java:418) at org.apache.derby.iapi.services.context.ContextManager.popContext(ContextManager.java:199) at org.apache.derby.iapi.services.context.ContextImpl.popMe(ContextImpl.java:81) at org.apache.derby.impl.store.access.RAMTransaction.destroy(RAMTransaction.java:2052) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.commitNestedTransaction(GenericLanguageConnectionContext.java:1510) at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:615) ... Works better if i filter by name, of the transaction, to NESTED_READONLY_USER_TRANS not being forced to abort at committing stage. I can describe better my project if need. Can this exception be a bug at this old version of Derby? Looking at XactFactory, we can have transaction with these contexts - USER_CONTEXT_ID - NESTED_READONLY_USER_CONTEXT_ID - NESTED_UPDATE_USER_CONTEXT_ID - INTERNAL_CONTEXT_ID - NTT_CONTEXT_ID and more at AccessFactoryGlobals - NESTED_READONLY_USER_TRANS - NESTED_UPDATE_USER_TRANS I need some help to understand this. What transactions with these context do? When is this NESTED_READONLY_USER_TRANS called? Thanks! PJ