Affects Version/s: 5.7.3
Fix Version/s: 5.8
Some concurrent updates in different overlapping transactions cause low-level SQL exceptions that should be managed better.
The basic use case is:
- worker starts running fulltext update
- worker checks that the document exists
- main thread deleted the document
- main thread commits
- worker saves the new fulltext, generating an INSERT or UPDATE on a row in the fulltext table which has as id a foreign key to hierarchy, which has just been deleted
In this case we have an exception which can be trapped and analyzed by the worker framework to allow retries.
Another case is pure deadlocks, where two transactions modify tables in different orders with a save() in between. In this case a deadlock (detected and broken by the database) is inevitable, and should at least be reported as a ConcurrentUpdateException.