db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1335418 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
Date Tue, 08 May 2012 11:22:19 GMT
Author: kahatlen
Date: Tue May  8 11:22:18 2012
New Revision: 1335418

URL: http://svn.apache.org/viewvc?rev=1335418&view=rev
Log:
DERBY-5736: NullPointerException in GenericTriggerExecutor.executeSPS() caused by OutOfMemoryError

Guard the cleanup with a null check to prevent masking the original
error with a NullPointerException.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java?rev=1335418&r1=1335417&r2=1335418&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
Tue May  8 11:22:18 2012
@@ -206,6 +206,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 
@@ -216,7 +220,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);
 				}



Mime
View raw message