Task #13171 (closed)
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
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,
- create a new Image
- fill in its mandatory properties
- persist the image
- create a new Pixels
- fill in its mandatory properties with its image set to the persisted image
- 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:
- What should I have done to get that simple scenario working?
- 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
Does work for simple plates but fails for the MIAS plate 001-365700055641.