I have a MySQL database with several tables and what I want is to block a record when reading it so that it is not read by another user until it stops reading or modifying it.
Is there anything in MySQL that allows me to do that?
I have a MySQL database with several tables and what I want is to block a record when reading it so that it is not read by another user until it stops reading or modifying it.
Is there anything in MySQL that allows me to do that?
If they are MyISAM tables, only tables with LOCK and UNLOCK TABLES statements can be blocked, which does not allow more than one user to work at a time. In the case of InnoDB tables there are more possibilities, you can see them here
Anyway, it may make sense to block a record while it is being modified, but while it is being read, ie for a select, it does not seem very functional, I guess it has to do with the logic of the process you use.