[hibernate-commits] Hibernate SVN: r15229 - core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Sep 29 19:28:05 EDT 2008


Author: gbadner
Date: 2008-09-29 19:28:05 -0400 (Mon, 29 Sep 2008)
New Revision: 15229

Modified:
   core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/CollectionLoadContext.java
   core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/LoadContexts.java
Log:
JBPAPP-984 HHH-2795 : CollectionLoadContexts for empy collections are not removed until PersistenceContext.clear()


Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/CollectionLoadContext.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/CollectionLoadContext.java	2008-09-29 21:45:42 UTC (rev 15228)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/CollectionLoadContext.java	2008-09-29 23:28:05 UTC (rev 15229)
@@ -153,7 +153,7 @@
 	public void endLoadingCollections(CollectionPersister persister) {
 		SessionImplementor session = getLoadContext().getPersistenceContext().getSession();
 		if ( !loadContexts.hasLoadingCollectionEntries()
-				|| localLoadingCollectionKeys.isEmpty() ) {
+				&& localLoadingCollectionKeys.isEmpty() ) {
 			return;
 		}
 

Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/LoadContexts.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/LoadContexts.java	2008-09-29 21:45:42 UTC (rev 15228)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/engine/loading/LoadContexts.java	2008-09-29 23:28:05 UTC (rev 15229)
@@ -132,6 +132,17 @@
 	 * false otherwise.
 	 */
 	public boolean hasLoadingCollectionEntries() {
+		return ( collectionLoadContexts != null && !collectionLoadContexts.isEmpty() );
+	}
+
+	/**
+	 * Do we currently have any registered internal entries corresponding to loading
+	 * collections?
+	 *
+	 * @return True if we currently hold state pertaining to a registered loading collections;
+	 * false otherwise.
+	 */
+	public boolean hasRegisteredLoadingCollectionEntries() {
 		return ( xrefLoadingCollectionEntries != null && !xrefLoadingCollectionEntries.isEmpty() );
 	}
 
@@ -228,7 +239,7 @@
 	 * @param key The key of the collection we are done processing.
 	 */
 	void unregisterLoadingCollectionXRef(CollectionKey key) {
-		if ( !hasLoadingCollectionEntries() ) {
+		if ( !hasRegisteredLoadingCollectionEntries() ) {
 			return;
 		}
 		xrefLoadingCollectionEntries.remove(key);




More information about the hibernate-commits mailing list