[hibernate-commits] Hibernate SVN: r10697 - branches/Branch_3_2/Hibernate3/src/org/hibernate/engine

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Nov 2 14:28:33 EST 2006


Author: steve.ebersole at jboss.com
Date: 2006-11-02 14:28:32 -0500 (Thu, 02 Nov 2006)
New Revision: 10697

Modified:
   branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/StatefulPersistenceContext.java
Log:
HHH-1756 : BatchFetchQueue and evicted proxies

Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/StatefulPersistenceContext.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/StatefulPersistenceContext.java	2006-11-02 19:28:15 UTC (rev 10696)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/StatefulPersistenceContext.java	2006-11-02 19:28:32 UTC (rev 10697)
@@ -836,10 +836,20 @@
 	}
 
 	/**
-	 * Remove a proxy from the session cache
+	 * Remove a proxy from the session cache.
+	 * <p/>
+	 * Additionally, ensure that any load optimization references
+	 * such as batch or subselect loading get cleaned up as well.
+	 *
+	 * @param key The key of the entity proxy to be removed
+	 * @return The proxy reference.
 	 */
 	public Object removeProxy(EntityKey key) {
-		return proxiesByKey.remove(key);
+		if ( batchFetchQueue != null ) {
+			batchFetchQueue.removeBatchLoadableEntityKey( key );
+			batchFetchQueue.removeSubselect( key );
+		}
+		return proxiesByKey.remove( key );
 	}
 
 	/**




More information about the hibernate-commits mailing list