db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r370978 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DistinctScalarAggregateResultSet.java
Date Sat, 21 Jan 2006 04:32:19 GMT
Author: bandaram
Date: Fri Jan 20 20:32:17 2006
New Revision: 370978

URL: http://svn.apache.org/viewcvs?rev=370978&view=rev
Log:
DERBY-756: Close scan controller in DistinctScalarAggregateResultSet to avoid memory leak.

Submitted by Manish Khettry (manish_khettry@yahoo.com)

Here is more info from the contributor:
It looks like the scan controller created in DistinctScalarAggregateResultSet is never closed.
This causes the scanController instance variable in RAMTransaction to continue to grow with
each open/close. 

Shouldn't DistinctScalarAggregateRS implement a close or a finish method (not sure what the
difference is) and close the scan controller there.

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

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DistinctScalarAggregateResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DistinctScalarAggregateResultSet.java?rev=370978&r1=370977&r2=370978&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DistinctScalarAggregateResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DistinctScalarAggregateResultSet.java
Fri Jan 20 20:32:17 2006
@@ -20,17 +20,8 @@
 
 package org.apache.derby.impl.sql.execute;
 
-import org.apache.derby.iapi.services.monitor.Monitor;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
-import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
-import org.apache.derby.iapi.services.stream.InfoStreams;
-
-import org.apache.derby.iapi.services.io.Formatable;
-
-import org.apache.derby.iapi.sql.execute.CursorResultSet;
-import org.apache.derby.iapi.sql.ResultSet;
 import org.apache.derby.iapi.sql.execute.ExecRow;
 import org.apache.derby.iapi.sql.execute.ExecIndexRow;
 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
@@ -45,19 +36,13 @@
 
 import org.apache.derby.iapi.services.loader.GeneratedMethod;
 
-import org.apache.derby.iapi.sql.execute.ExecutionFactory;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
-import org.apache.derby.iapi.types.RowLocation;
 
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.services.io.FormatableArrayHolder;
 
 import java.util.Properties;
-import java.util.Vector;
-import java.util.Enumeration;
+
 
 /**
  * This ResultSet evaluates scalar aggregates where
@@ -272,6 +257,14 @@
 		openTime += getElapsedMillis(beginTime);
 	}
 
+        /**
+         * @inheritDoc
+         */
+        public void close() throws StandardException
+        {
+            super.close();
+            closeSource();
+        }
 	///////////////////////////////////////////////////////////////////////////////
 	//
 	// SCAN ABSTRACTION UTILITIES



Mime
View raw message