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/28 09:53:27 UTC

svn commit: r533314 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile: DeleteNode.java InsertNode.java UpdateNode.java

Author: kahatlen
Date: Sat Apr 28 00:53:26 2007
New Revision: 533314

URL: http://svn.apache.org/viewvc?view=rev&rev=533314
Log:
DERBY-827 (partial) Performance can be improved by re-using language
ResultSets across Activation executions.

Move code that marks a temporary table as modified from
fillResultSet() into the execute() method of result sets that perform
update/delete/insert on the table.

Patch contributed by Dyre Tjeldvoll.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java?view=diff&rev=533314&r1=533313&r2=533314
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java Sat Apr 28 00:53:26 2007
@@ -525,8 +525,11 @@
 							throws StandardException
 	{
 
-		//If the DML is on the temporary table, generate the code to mark temporary table as modified in the current UOW
-		generateCodeForTemporaryTable(acb, mb);
+		// If the DML is on the temporary table, generate the code to
+		// mark temporary table as modified in the current UOW. After
+		// DERBY-827 this must be done in execute() since
+		// fillResultSet() will only be called once.
+		generateCodeForTemporaryTable(acb, acb.getExecuteMethod());
 
 		/* generate the parameters */
 		if(!isDependentTable)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java?view=diff&rev=533314&r1=533313&r2=533314
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java Sat Apr 28 00:53:26 2007
@@ -814,8 +814,11 @@
 								MethodBuilder mb)
 							throws StandardException
 	{
-		//If the DML is on the temporary table, generate the code to mark temporary table as modified in the current UOW
-		generateCodeForTemporaryTable(acb, mb);
+		// If the DML is on the temporary table, generate the code to
+		// mark temporary table as modified in the current UOW. After
+		// DERBY-827 this must be done in execute() since
+		// fillResultSet() will only be called once.
+		generateCodeForTemporaryTable(acb, acb.getExecuteMethod());
 
 		/* generate the parameters */
 		generateParameterValueSet(acb);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?view=diff&rev=533314&r1=533313&r2=533314
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java Sat Apr 28 00:53:26 2007
@@ -780,8 +780,11 @@
 								MethodBuilder mb)
 							throws StandardException
 	{
-		//If the DML is on the temporary table, generate the code to mark temporary table as modified in the current UOW
-		generateCodeForTemporaryTable(acb, mb);
+		// If the DML is on the temporary table, generate the code to
+		// mark temporary table as modified in the current UOW. After
+		// DERBY-827 this must be done in execute() since
+		// fillResultSet() will only be called once.
+		generateCodeForTemporaryTable(acb, acb.getExecuteMethod());
 
 		/* generate the parameters */
 		if(!isDependentTable)