© Jesper Wisborg Krogh 2021
J. W. KroghMySQL Concurrencyhttps://doi.org/10.1007/978-1-4842-6652-6_8

8. Working with Lock Conflicts

Jesper Wisborg Krogh1  
(1)
Hornsby, NSW, Australia
 

The whole idea of locks is to restrict access to objects or records to avoid conflicting operations to concurrently access the object or records in a safe way. That means that, sometimes, a lock cannot be granted. What happens in that case? It depends on the locks requested and the circumstances. Metadata (including explicitly requested table locks) and InnoDB locks operate with a timeout, and for some lock cases explicit deadlock detection exist.

It is important to understand that failures to obtain locks are a fact of life when working with databases. In principle you ...

Get MySQL Concurrency: Locking and Transactions for MySQL Developers and DBAs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.