forked from kitodo/kitodo-production
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix HibernateException: could not re-associate uninitialized transient
... collection". This is caused because the object being saved has a lazy-loading collection that is not loaded, but it is no longer attached to a session. The solution is to merge (re-attach) the object to the current session before doing something with it again. The merge operation cannot modify the current object, but returns a new (proxy) object that must be used from now on. To make this counterintuitive behaviour of the API more obvious, the CheckReturnValue annotation was introduced, which is evaluated by Spotbugs, which results in a Spotbugs alert if it is ignored.
- Loading branch information
1 parent
83c912c
commit 955a03a
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters