CollectionLoadContexts for empy collections are not removed until PersistenceContext.clear()

Description

A CollectionLoadContext is created for an empty ResultSet but is not registered with LoadContexts. This causes CollectionLoadContexts.endLoadingCollection() too return early without removing the CollectionLoadContext().

As a result, the CollectionLoadContext is not removed until PersistenceContext.clear() is called which calls LoadContexts.cleanup(). When a CollectionLoadContext is still in present, LoadContexts.cleanup() writes a warning to the log, as mentioned in HHH-2631.

This is reproduced by org.hibernate.engine.loading.MergeTest.testNoExtraUpdatesOnMergeWithCollection() as well as other unit tests.

Environment

None

Activity

Show:
Gail Badner
August 20, 2007, 1:10 AM

Fixed in trunk / 3.2

Assignee

Gail Badner

Reporter

Gail Badner

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure