db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r610895 - /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
Date Thu, 10 Jan 2008 19:41:21 GMT
Author: djd
Date: Thu Jan 10 11:41:20 2008
New Revision: 610895

URL: http://svn.apache.org/viewvc?rev=610895&view=rev
Log:
DERBY-3247 Mark the activations for dynamic result sets as single use once they are returned
to the applications JDBC statement. Ensures that the close of the ResultSet will close the
activation.
Merge of Revision 601386 from trunk excluding the changes to EmbedStatement. Those changes
were comments to the finalizer method which does not exist in 10.3 

Modified:
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java?rev=610895&r1=610894&r2=610895&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
Thu Jan 10 11:41:20 2008
@@ -133,7 +133,8 @@
 	/**
 	 This activation is set by EmbedStatement
 	 for a single execution Activation. Ie.
-	 a ResultSet from a Statement.executeQuery().
+	 a ResultSet from a Statement.executeQuery() or
+     a ResultSet that is now a dynamic result set.
 	 In this case the closing of this ResultSet will close
 	 the activation or the finalization of the ResultSet
 	 without it being closed will mark the Activation as unused.
@@ -4419,6 +4420,16 @@
 
 		this.owningStmt = owningStmt;
 		this.localConn = owningStmt.getEmbedConnection();
+        
+        // The activation that created these results now becomes
+        // a single use activation so it will be closed when this
+        // object is closed. Otherwise the activation would
+        // only be closed on garbage collection for any
+        // dynamic result set created by a PreparedStatement
+        // or CallableStatement. Dynamic result sets created
+        // by Statement objects will already be marked as
+        // single use.
+        this.singleUseActivation = theResults.getActivation();
 	}
 
 	/*



Mime
View raw message