Task #346 (new)
Opened 18 years ago
Last modified 9 years ago
Passing non-proxied one-to-manys to server can return empty (non-null) collection — at Initial Version
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Milestone: | 3.0-M3 |
Component: | Model | Version: | 3.0-M1 |
Keywords: | collections, links, proxies, unloading, corruption | Cc: | cxallan |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
Several model objects have methods for adding items to collection-valued fields:
* Pixels.addThumbnail(Thumbnail) * Project.linkDataset(Dataset)
These calls add the argument to their own collection and then call the reverse method on the arguments:
* Thumnail.setPixels(Pixels) * ProjectDatasetLink.setProject(Project)
The collections are ignored by Hibernate, and only the reverse methods have an effect. This is known behavior.
However, when one uses only the reverse methods (e.g. setPixels(Pixels)) and the Pixels instance is not a proxy (e.g. pixels.isLoaded()==true) then the Pixels instance which is returned by the IUpdate.saveAndReturnObject() method is neither unloaded, nor is the collection nulled, nor does it contain the newly added Thumbnail which could easily lead to data corruption.