• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Ticket
  • Next Ticket →

Ticket #118 (assigned defect)

Opened 2 years ago

Last modified 7 months ago

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

Change History

Changed 2 years ago by jmoore

  • status changed from new to assigned

Need to try out newer (3.2.x) versions of Hibernate to see if this is fixed. Also important for security (#114) and the new model (#96). Moving to the next milestone:3.0-M3

Changed 2 years ago by jmoore

  • milestone changed from 3.0-M2 to 3.0-M3

Changed 2 years ago by jmoore

Not having versions is again causing massive troubles from the client side. (Just versions would cause an equal number of stale object exceptions, but in combination with the client session should be seamless.)

An example of a problem is the following:

    Experimenter user1 = iAdmin.lookupExperimenter("user1")";
    Experimenter newUser = iAdmin.createUser( userDTO );
    // ... create an object belonging to user1
    iUpdate.saveObject( object ); 
    // which removes newUser from the user group! 

This happens because the set of GroupExperimenterMaps attached to user1 doesn't contain the new map from newUser to the user group. Since there is no version to tell Hibernate that the sets from user are stale, it removes the link. Boom'''

Changed 2 years ago by jmoore

HHH-1564 appears to be related.

Changed 2 years ago by jmoore

http://forum.hibernate.org/viewtopic.php?t=950225&highlight=collectiontype+isdirty

Changed 2 years ago by jmoore

This is being fixed and is planned for Hibernate 3.2.1. There may be other issues: see HHH-85 (ref. the propery hibernate.batch_update_versioned)

Changed 2 years ago by jmoore

  • keywords hibernate,versions,iteration5 added; hibernate,versions removed

Changed 2 years ago by jmoore

#81 might offer us another way out (update events)

Changed 2 years ago by jmoore

If we go the #81 route (using update events) then rather then throwing a SecurityViolation it needs to throw an OptimisticLockException.

Changed 2 years ago by jmoore

Note to previous comment: again if we got the #81 comment, we will have to prevent null update events for managed entities. I.e.

 * NullId/NullUpdateEvent    --> OK
 * NullId/NonNullUpdateEvent --> Not ok.
 * NonNullId/NullUpdateEvent --> Not ok.
 * Both non null             --> OK

Changed 2 years ago by jmoore

  • keywords hibernate,versions added; hibernate,versions,iteration5 removed
  • milestone changed from 3.0-M3 to Blocked

Still waiting on a response from the Hibernate team. Moving to milestone:Blocked

Changed 22 months ago by jmoore

  • milestone changed from Blocked to 3.0-M4

They say they've fixed it as of hibernate:r10740 . We need to test that. Rescheduling.

See also: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2217

Changed 16 months ago by jmoore

  • milestone changed from 3.0-Beta2 to 3.0-Beta3

This just got missed in milestone:3.0-Beta2. Certainly time to upgrade Hibernate versions.

Changed 7 months ago by jmoore

  • milestone changed from 3.0-Beta3 to 3.0-Beta4

We've upgraded, and this problem has not shown up again. However, versions still need to be reviewed. Pushing.

Note: See TracTickets for help on using tickets.

Download in other formats:

  • Comma-delimited Text
  • Tab-delimited Text
  • RSS Feed

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/