[PP-2065] Address library not persistent within session errors by ens… #2246
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…uring the
library and other objects accessed within the new transaction are attached to the session.
Description
I was using session.refresh(obj) instead of session.merge(obj).
merge
reattaches a detached object to the session whererefresh
refreshes an object that is already associated with the session.Motivation and Context
https://ebce-lyrasis.atlassian.net/browse/PP-2065
How Has This Been Tested?
To be verified on Minotaur.
Checklist