You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
The text was updated successfully, but these errors were encountered:
Found another issue here. If I turn off FORCE_LAZY_LOADING for the module, it still opens the session since there is no check for the collection already being initialized before doing so. In other words, the FORCE_LAZY_LOADING feature doesn't actually matter in this case, the collection should be checked for wasInitialized before setting up a session and calling initialize on it.
I have an
ElementCollection
on my object that is defaulting to lazy loading, but in myCriteria
I've set theFetchMode
toJoin
, which initializes the collection. While this causes the initialization of the collection to be identical toFetchType.Eager
on the collection itself, it's marked at using lazy loading and therefore falls into the code linked here:jackson-datatype-hibernate/hibernate5/src/main/java/com/fasterxml/jackson/datatype/hibernate5/PersistentCollectionSerializer.java
Lines 287 to 295 in 7ae60e9
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?The text was updated successfully, but these errors were encountered: