Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #13171 (closed)

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

Bug: Duplicate can't copy plates with runs

Reported by: mtbcarroll Owned by: mtbcarroll
Priority: major Milestone: OMERO-5.2.3
Component: ApplicationServer Version: OMERO-5.2.0
Keywords: n.a. Cc: ux@…, server@…
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

If a plate has a run then Duplicate errors in duplicating the plate or run.

Change History (7)

comment:1 Changed 8 years ago by mtbcarroll

  • Status changed from new to accepted

Does work for simple plates but fails for the MIAS plate 001-365700055641.

comment:2 Changed 8 years ago by mtbcarroll

Duplication seems to work fine for whatever richer plates I construct in integration testing. However, the MIAS plate failure is reproducible: it may point to a general problem with attempting to persist a transient model graph with Hibernate. On looping through the duplicates to persist them I get exceptions like,

not-null property references a null or transient value: ome.model.screen.WellSample.image

but all the well samples do have images, probably just not ones that are yet persisted themselves. While I'd hoped that the twin magic of FlushMode.COMMIT and @Cascade(CascadeType.PERSIST) would suffice, my guess is that I may need to session.persist the new subgraph nodes in an order that has no property refer to a not-yet-persisted one, even though for other plates it works fine even when that constraint is repeatedly violated.

comment:3 Changed 8 years ago by mtbcarroll

  • Cc server@… added

With some pain I've introduced rather more ordering into how the newly duplicated subgraph is persisted. However, I haven't yet determined what the suitable ordering would be. For example, if I,

  1. create a new Image
  2. fill in its mandatory properties
  3. persist the image
  4. create a new Pixels
  5. fill in its mandatory properties with its image set to the persisted image
  6. persist the pixels

then I get,

not-null property references a null or transient value: ome.model.core.Pixels._pixelsBackref

This is also true if I use image.addPixels(pixels); instead. It fails differently if I use pixels.setImage(image.proxy());.

I assume I'm just forgetting some basic Hibernate stuff here. However, really there are two questions:

  1. What should I have done to get that simple scenario working?
  2. How can that be automatically determined in the general case?

comment:4 Changed 8 years ago by mtbcarroll

I was mistaken: if I instead use image.addPixels(pixels) it works fine. Pixels.getImage() is annotated with insertable=false, updatable=false. Will accordingly look at further revising code.

comment:5 Changed 8 years ago by mtbcarroll

Still working through interesting Hibernate issues and making steady progress. The latest is that if I want to add a channel to the beginning of a list of channels on Pixels then I can't just do,

pixels.addChannel(channel1);
session.persist(channel1);
...
pixels.clearChannels();
pixels.addChannel(channel2);
pixels.addChannel(channel1);
session.persist(channel2);

because Hibernate performs the update in a manner that violates channel_pixels_pixels_index_key.

comment:6 Changed 8 years ago by mtbcarroll

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:7 Changed 8 years ago by mtbcarroll

  • Milestone changed from Unscheduled to OMERO-5.2.3
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.64350 sec.)

We're Hiring!