29d8acf4d5
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.
Description
No description provided
Languages
Java
91%
HTML
8.6%
CSS
0.3%
JavaScript
0.1%