-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
I have an ElementCollection
on my object that is defaulting to lazy loading, but in my Criteria
I've set the FetchMode
to Join
, which initializes the collection. While this causes the initialization of the collection to be identical to FetchType.Eager
on the collection itself, it's marked at using lazy loading and therefore falls into the code linked here:
Lines 287 to 295 in 7ae60e9
if (!Feature.FORCE_LAZY_LOADING.enabledIn(_features) && !coll.wasInitialized()) { | |
return null; | |
} | |
if (_sessionFactory != null) { | |
// 08-Feb-2017, tatu: and not closing this is not problematic... ? | |
Session session = openTemporarySessionForLoading(coll); | |
initializeCollection(coll, session); | |
} | |
return coll.getValue(); |
I think getting to this point is fine, but shouldn't it be checked that !coll.wasInitialized()
on line 290, prior to opening a temporary session that will essentially do nothing since the collection is already initialized?
Metadata
Metadata
Assignees
Labels
No labels