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 #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

Solved as part of #2547.

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.65349 sec.)

We're Hiring!