You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2007/04/23 08:26:12 UTC

svn commit: r531349 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MiscResultSet.java

Author: kahatlen
Date: Sun Apr 22 23:26:11 2007
New Revision: 531349

URL: http://svn.apache.org/viewvc?view=rev&rev=531349
Log:
DERBY-827 (partial) Make sure MiscResultSet picks up a new
ConstantAction after a recompile.

Patch contributed by Dyre Tjeldvoll.

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

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MiscResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MiscResultSet.java?view=diff&rev=531349&r1=531348&r2=531349
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MiscResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MiscResultSet.java Sun Apr 22 23:26:11 2007
@@ -22,21 +22,23 @@
 package org.apache.derby.impl.sql.execute;
 
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.Activation;
 
 
 /**
- *	This is a wrapper class which invokes the Execution-time logic for
- *	Misc statements. The real Execution-time logic lives inside the
- *	executeConstantAction() method of the Execution constant.
- *
+ * This is a wrapper class which invokes the Execution-time logic for
+ * Misc statements. The real Execution-time logic lives inside the
+ * executeConstantAction() method. Note that when re-using the
+ * language result set tree across executions (DERBY-827) it is not
+ * possible to store the ConstantAction as a member variable, because
+ * a re-prepare of the statement will invalidate the stored
+ * ConstantAction. Re-preparing a statement does not create a new
+ * Activation unless the GeneratedClass has changed, so the existing
+ * result set tree may survive a re-prepare.
  */
 
 class MiscResultSet extends NoRowsResultSetImpl
 {
-	private final ConstantAction constantAction;
-
 	/**
      * Construct a MiscResultSet
 	 *
@@ -48,16 +50,25 @@
 		 throws StandardException
     {
 		super(activation);
-		constantAction = activation.getConstantAction();
 	}
     
+	/**
+	 * Opens a MiscResultSet, executes the Activation's
+	 * ConstantAction, and then immediately closes the MiscResultSet.
+	 *
+	 * @exception StandardException Standard Derby error policy.
+	 */
 	public void open() throws StandardException
 	{
-		constantAction.executeConstantAction(activation);
+		activation.getConstantAction().executeConstantAction(activation);
 		super.close();
 	}
 
+	// Does not override close() (no action required)
+	// Does not override finish() (no action required)
+
 	/**
+	 * No action is required, but not implemented in any base class
 	 * @see org.apache.derby.iapi.sql.ResultSet#cleanUp
 	 */
 	public void	cleanUp()