db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r540921 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/Activation.java impl/sql/GenericActivationHolder.java impl/sql/execute/BaseActivation.java impl/sql/execute/NoPutResultSetImpl.java
Date Wed, 23 May 2007 11:08:01 GMT
Author: kahatlen
Date: Wed May 23 04:08:00 2007
New Revision: 540921

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

This patch enables re-use of language ResultSets.

Contributed by Daniel John Debrunner.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoPutResultSetImpl.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java?view=diff&rev=540921&r1=540920&r2=540921
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/Activation.java Wed May 23 04:08:00
2007
@@ -215,11 +215,6 @@
 	ResultSet getResultSet();
 
 	/**
-	 * Sets the ResultSet to be returned by getResultSet() to null.
-	 */
-	void clearResultSet();
-
-	/**
 	 * Generated plans have a current row field for ease in defining
 	 * the methods and finding them dynamically. The interface is
 	 * used to set the row before a dynamic method that uses it is

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java?view=diff&rev=540921&r1=540920&r2=540921
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericActivationHolder.java
Wed May 23 04:08:00 2007
@@ -337,14 +337,6 @@
 	}
 
 	/**
-	 * @see Activation#clearResultSet
-	 */
-	public void clearResultSet()
-	{
-		ac.clearResultSet();
-	}
-
-	/**
 	 * @see Activation#setCurrentRow
 	 *
 	 */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java?view=diff&rev=540921&r1=540920&r2=540921
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java
Wed May 23 04:08:00 2007
@@ -244,10 +244,6 @@
 		return resultSet;
 	}
 
-	public void clearResultSet() {
-		resultSet = null;
-	}
-
 	/**
 		Get the saved RowLocation.
 
@@ -315,7 +311,6 @@
 				// would really like to check if it is open,
 				// this is as close as we can approximate that.
 				resultSet.close();
-				resultSet = null; // forget about it, prepare for next exec.
 			} else if (resultSet.returnsRows()) {
 				resultSet.clearCurrentRow();
 			}
@@ -344,20 +339,19 @@
 			
 			// markUnused();
 
-			// we finish the result set before we call reset
-			// because reset will set it to null.
-			if (resultSet != null)
-			{
-				resultSet.finish();
-				resultSet = null;
-			}
-
 			// we call reset so that if the actual type of "this"
 			// is a subclass of BaseActivation, its cleanup will
 			// also happen -- reset in the actual type is called,
 			// not reset in BaseActivation.  Subclass reset's
 			// are supposed to call super.reset() as well.
 			reset(); // get everything related to executing released
+
+			if (resultSet != null)
+			{
+				// Finish the resultSet, it will never be used again.
+				resultSet.finish();
+				resultSet = null;
+			}
 
 			closed = true;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoPutResultSetImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoPutResultSetImpl.java?view=diff&rev=540921&r1=540920&r2=540921
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoPutResultSetImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoPutResultSetImpl.java
Wed May 23 04:08:00 2007
@@ -187,15 +187,6 @@
 			}
 		}
 
-		/*
-		** If we are the activation's top result set, make it forget about
-		** us, because we're closed now.
-		*/
-		if (activation.getResultSet() == this)
-		{
-			activation.clearResultSet();
-		}
-
 		isOpen = false;
 
 	}



Mime
View raw message