You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my Project I have a unique index on the order column. When reordering the entries I receive a 'duplicate key entry' error for the order column. While investigating the code I noticed that the reordering is not encapsulated within a db-transaction.
I understand that in some cases one might not want to use a transaction but in general I would really like to have the ability to decide weather to use a transaction or not. Also a transaction would solve the duplicate key error:
Start transaction
Move the entry to the end (max possible sorting value)
Reorder the other entries if needed
Assign the now free order value to the entry from (2)
Commit transaction
Using a transaction will prevent users from seeing an incorrect ordering in step (2)
The text was updated successfully, but these errors were encountered:
In my Project I have a unique index on the order column. When reordering the entries I receive a 'duplicate key entry' error for the order column. While investigating the code I noticed that the reordering is not encapsulated within a db-transaction.
I understand that in some cases one might not want to use a transaction but in general I would really like to have the ability to decide weather to use a transaction or not. Also a transaction would solve the duplicate key error:
Using a transaction will prevent users from seeing an incorrect ordering in step (2)
The text was updated successfully, but these errors were encountered: