Do mysql things necessarily cause table locks?

Does

mysql things necessarily cause table locks?

Mar.24,2021

transaction isolation level understood, but whether things will cause table locks does not quite understand


this depends on the transaction isolation level. Mysql defaults to "repeatable" and prevents illusion reading through the multi-version concurrency control of the innodb engine (MVCC,Multiversion Concurrency Control) mechanism). Similarly, the subsequent select will not be locked.
when the transaction isolation level is raised to "serialization", as long as the previous session does not have a commit (including after the select), then any operation of the subsequent session will be locked.

Menu