db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r201659 - /incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
Date Fri, 24 Jun 2005 18:08:49 GMT
Author: bandaram
Date: Fri Jun 24 11:08:47 2005
New Revision: 201659

URL: http://svn.apache.org/viewcvs?rev=201659&view=rev
Log:
DERBY-388: Address intermittent failures when executing trigger statements caused by references
to internal SQL formats. (Generated because of expanding OLD and/or NEW transition variables)

Submitted by Army Brown (qozinx@sbcglobal.net)

Modified:
    incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java

Modified: incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java?rev=201659&r1=201658&r2=201659&view=diff
==============================================================================
--- incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
(original)
+++ incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
Fri Jun 24 11:08:47 2005
@@ -339,7 +339,20 @@
 
 			/* put it in try block to unlock the PS in any case
 			 */
-			rePrepare(lccToUse);
+			if (!spsAction) {
+			// only re-prepare if this isn't an SPS for a trigger-action;
+			// if it _is_ an SPS for a trigger action, then we can't just
+			// do a regular prepare because the statement might contain
+			// internal SQL that isn't allowed in other statements (such as a
+			// static method call to get the trigger context for retrieval
+			// of "new row" or "old row" values).  So in that case we
+			// skip the call to 'rePrepare' and if the statement is out
+			// of date, we'll get a NEEDS_COMPILE exception when we try
+			// to execute.  That exception will be caught by the executeSPS()
+			// method of the GenericTriggerExecutor class, and at that time
+			// the SPS action will be recompiled correctly.
+				rePrepare(lccToUse);
+			}
 
 			StatementContext statementContext = lccToUse.pushStatementContext(
 				isAtomic, getSource(), pvs, rollbackParentContext);



Mime
View raw message