Andreas Svanberg 29d8acf4d5 3361 Fix simultaneous requests to open the same checklist
What happens in there are simultaneous requests to open a checklist.
Both threads will read the checklist from the database, and since it
is versioned they will both get version N.
Then both threads will try to update the last open date and save the
checklist. When saving a versioned object a SQL query of the form
UPDATE checklist SET version = N+1 WHERE id = ? AND version = N
is generated, the first such query will succeed but the second one
will not update any row which Hibernate treats as an optimistic
locking error.
To work around this we use a global lock to ensure that only one
thread can update the checklist at a time. We can't use the
EntityManagers lock method since that too will cause an optimistic
locking failure. This is an unfortunate global lock that will affect
everyone even if they open different checklist, but it is such an
underused feature that it should not be a problem.
2024-04-22 15:28:08 +02:00
2023-12-01 15:40:40 +01:00
2013-10-10 11:16:14 +09:00
2013-11-14 12:04:53 +09:00
2015-02-05 15:56:03 +01:00
2024-04-22 09:30:47 +02:00
2024-04-22 12:18:12 +02:00
Description
No description provided
77 MiB
Languages
Java 91%
HTML 8.6%
CSS 0.3%
JavaScript 0.1%