Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A477104E7 for ; Thu, 1 Aug 2013 21:28:28 +0000 (UTC) Received: (qmail 87244 invoked by uid 500); 1 Aug 2013 21:28:28 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 87225 invoked by uid 500); 1 Aug 2013 21:28:28 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 87216 invoked by uid 99); 1 Aug 2013 21:28:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 21:28:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 21:28:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CAA8B2388860; Thu, 1 Aug 2013 21:28:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1509434 - in /db/derby/code/branches/10.8: ./ java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java Date: Thu, 01 Aug 2013 21:28:06 -0000 To: derby-commits@db.apache.org From: kmarsden@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130801212806.CAA8B2388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kmarsden Date: Thu Aug 1 21:28:06 2013 New Revision: 1509434 URL: http://svn.apache.org/r1509434 Log: DERBY-5736 NullPointerException in GenericTriggerExecutor.executeSPS() caused by OutOfMemoryError merge revision 1335418 from trunk to 10.8 Contributed by Knut Anders Hatlen Modified: db/derby/code/branches/10.8/ (props changed) db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java Propchange: db/derby/code/branches/10.8/ ------------------------------------------------------------------------------ Merged /db/derby/code/trunk:r1335418 Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java?rev=1509434&r1=1509433&r2=1509434&view=diff ============================================================================== --- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java (original) +++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java Thu Aug 1 21:28:06 2013 @@ -203,6 +203,10 @@ public abstract class GenericTriggerExec ** trigger executor needs to ensure that the current active SC ** is associated with the SPS, so that it is cleaning up the ** right statement context in LCC. + ** + ** It is also possible that the error has already been handled + ** on a lower level, especially if the trigger re-enters the + ** JDBC layer. In that case, the current SC will be null. ** ** When the active SC is cleaned up, the TEC will be removed ** from LCC and the SC object will be popped off from the LCC @@ -213,7 +217,7 @@ public abstract class GenericTriggerExec StatementContext sc = lcc.getStatementContext(); /* make sure that the cleanup is on the new SC */ - if (active_sc != sc) + if (sc != null && active_sc != sc) { sc.cleanupOnError(e); }