db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r219113 - /incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
Date Thu, 14 Jul 2005 21:47:33 GMT
Author: bandaram
Date: Thu Jul 14 14:47:31 2005
New Revision: 219113

URL: http://svn.apache.org/viewcvs?rev=219113&view=rev
Log:
Port fix for DERBY-388 into 10.1 branch. Address intermittent failures when executing trigger
statements caused by references to internal SQL formats.

Fix originally submitted to 10.0 branch by Army Brown (qozinx@sbcglobal.net)

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

Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java?rev=219113&r1=219112&r2=219113&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
(original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java
Thu Jul 14 14:47:31 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