DefaultInitializeCollectionEventListener not finding collections in cache

Description

Recent commit to DefaultInitializeCollectionEventListener caused that even if a collection is found in cache sql query is executed. It works as expected when you have trace logging enabled.

if ( foundInCache && traceEnabled ) {
LOG.trace( "Collection initialized from cache" );
} else {
if ( traceEnabled ) {
LOG.trace( "Collection not cached" );
}
// database hit
ce.getLoadedPersister().initialize( ce.getLoadedKey(), source );
}

should be

if ( foundInCache ) {
if(traceEnabled) {
LOG.trace( "Collection initialized from cache" );
}
} else {

Environment

None

Activity

Show:
Jiří Pejchal
May 15, 2013, 6:31 PM
Brett Meyer
May 16, 2013, 3:58 PM

Good catch & thank you for the pull request!

Assignee

Brett Meyer

Reporter

Jiří Pejchal

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure