Task #1277 (closed)
Opened 15 years ago
Closed 14 years ago
Trigger on update child_index (ordered collection) can be confusing
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | minor | Milestone: | OMERO-Beta4.2 |
Component: | General | Version: | 3.0-M1 |
Keywords: | n.a. | Cc: | cxallan |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
The triggers installed to prevent weirdness with Hibernate ordered collections updates (#1056) pose their own weirdness when working from psql:
JcbProduction=> select * from groupexperimentermap where child = 952; id | permissions | version | child | creation_id | external_id | group_id | owner_id | update_id | parent | child_index ------+-------------+---------+-------+-------------+-------------+----------+----------+-----------+--------+------------- 1208 | -1 | 0 | 952 | 5592188 | | 0 | 0 | 5592188 | 1 | 2 1207 | -1 | 0 | 952 | 5592188 | | 0 | 0 | 5592188 | 0 | 0 1206 | -1 | 0 | 952 | 5592188 | | 0 | 0 | 5592188 | 1052 | 1 (3 rows) omero => delete from groupexperimentermap where id = 1207; DELETE 1 omero=> update groupexperimentermap set child_index = child_index - 1 where child = 952; NOTICE: Remapping groupexperimentermap 1206 via (-1 - oldvalue ) UPDATE 1 omero=> \q
Perhaps a function which users could use set_default() for example, would be useful.
Change History (2)
comment:1 Changed 15 years ago by jmoore
- Milestone changed from OMERO-Beta4.1 to Future
comment:2 Changed 14 years ago by jmoore
- Milestone changed from Unscheduled to OMERO-Beta4.2
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
Solved as part of #2547.