Ticket #118 (assigned defect)
Hibernate session.merge() is updating non-changed entities.
| Reported by: | jmoore | Owned by: | jmoore |
|---|---|---|---|
| Priority: | blocker | Milestone: | 3.0-Beta4 |
| Component: | API | Version: | 3.0-M1 |
| Keywords: | hibernate,versions | Cc: | jburel, callan |
Description
It was found in r582 that calls to session.merge() were cascading to all instances so that versions in Experimenter, EventTypes, etc. are being incremented. This was hellish for clients trying to deal with optimistic locks.
This is a hibernate bug. See http://opensource.atlassian.com/projects/hibernate/browse/HHH-1401 (version 3.2 may help)
Revisions r590, r591, and r597 made temporary fixes so work could continue without versions.
Before we close this, we need to re-instate versions and finish the update tests (like DetachedPixelsGraphTest) which test the possible combinations of transient/detached graphs.
- Transient root with:
- transient entity
- "transient" collection
- unloaded entity
- filtered collection (ERROR)
- Detached root with:
- transient entities/collections
- detached entities/collections
- filtered entities/collections
Also we need to make sure that the bug fix really worked, i.e.:
- re-merging unchanged detached --> no version increment
- re-merging changed --> version++ (also re: collections)
A possible Abstract test would be of the form:
class {
createGraph();
saveGraph();
checkIds();
checkVersions();
checkLogs();
}
Originally http://bugs.openmicroscopy.org.uk/show_bug.cgi?id=646
