Bug #357 (closed)
Opened 18 years ago
Closed 18 years ago
Pixels/image one-to-one relationship requires BOTH sides to be locked
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Cc: | |
Sprint: | n.a. | ||
Total Remaining Time: | n.a. |
Description
Locking functionality (#337) requires that all readable objects A be locked when another object B references them such that later reads of B won't fail because A is no longer readable. This had only been verified for the one side of one-to-many collections. It is apparently also a problem for one-to-one relationships.
Currently, this is only generated in our model for "tagged" elements:
<type id="ome.model.core.Image" named="true" described="true"> <properties> <zeromany name="pixels" type="ome.model.core.Pixels" inverse="image"/> <onemany name="defaultPixels" type="ome.model.core.Pixels" tag="defaultPixels"/>
The query produced is:
select <columns omitted> from image image0_ left outer join pixels pixels1_ on 'true'=pixels1_.defaultPixels and image0_.id=pixels1_.image and -- Now for the security filters: ( ? OR (pixels1_.group_id in (?)) OR (pixels1_.owner_id = ? AND (cast(pixels1_.permissions as bit(64)) & cast(1024 as bit(64))) = cast(1024 as bit(64))) OR (pixels1_.group_id in (?) AND (cast(pixels1_.permissions as bit(64)) & cast(64 as bit(64))) = cast(64 as bit(64))) OR ((cast(pixels1_.permissions as bit(64)) & cast(4 as bit(64))) = cast(4 as bit(64))) ) left outer join pixels pixels2_ on image0_.id=pixels2_.image and ( ? OR (pixels2_.group_id in (?)) OR (pixels2_.owner_id = ? AND (cast(pixels2_.permissions as bit(64)) & cast(1024 as bit(64))) = cast(1024 as bit(64))) OR (pixels2_.group_id in (?) AND (cast(pixels2_.permissions as bit(64)) & cast(64 as bit(64))) = cast(64 as bit(64))) OR ((cast(pixels2_.permissions as bit(64)) & cast(4 as bit(64))) = cast(4 as bit(64))) ) where ( ? OR (image0_.group_id in (?)) OR (image0_.owner_id = ? AND (cast(image0_.permissions as bit(64)) & cast(1024 as bit(64))) = cast(1024 as bit(64))) OR (image0_.group_id in (?) AND (cast(image0_.permissions as bit(64)) & cast(64 as bit(64))) = cast(64 as bit(64))) OR ((cast(image0_.permissions as bit(64)) & cast(4 as bit(64))) = cast(4 as bit(64))) ) and image0_.id=?
Change History (4)
comment:1 Changed 18 years ago by jmoore
comment:2 Changed 18 years ago by jmoore
- Keywords changed from iteration5 to iteration5, LATER, REVIEW
- Resolution set to fixed
- Status changed from new to closed
This test is actually insufficient, because pixels due to its non-null constraints will always be locked. The only other example of a defaultTag that we have is GroupExperimenterMap, which is a system type.
This will need to be reviewed later. Closing.
comment:3 Changed 18 years ago by jmoore
- Keywords changed from iteration5, LATER, REVIEW to iteration6
- Resolution fixed deleted
- Status changed from closed to reopened
This goes a bit deeper. Reopening. The login in ExtendedMetadata does not properly handle embedded components (a typical illness even for the Hibernate core).
r978 contains a failing test.
comment:4 Changed 18 years ago by jmoore
- Keywords changed from iteration6 to LATER,REVIEW,iteration6
- Resolution set to fixed
- Status changed from reopened to closed
r979 refactors ExtendedMetadata and adds embedded component ("subtype") functionality. This now allows us to lock things like Pixels.defaultTag.image. This class stands to get more complicated the more we add to our object model.
r936 provides a target test.