Home > Software engineering >  Multiple clients to access the MySQL database, how to lock
Multiple clients to access the MySQL database, how to lock

Time:12-12

Everyone a great god, and ask questions:
Such as, there are two client A, B, common database access DB
A are B to write A DB status for the operation of the 1, after you've written queries the status field in the current DB is 1 the number of rows
A and B serial execution is certainly no problem,
The key is A and B in parallel, there will be A and B are written after 1 to query the status field is 1 the number of lines is still 1

I think may be need to lock in A write to the DB, add the database lock, let B reads waiting for DB
But under the specific methods and I need to check how to add

Want to ask next everybody here, everyone a great god met is specific what to do with this problem?

thank you

CodePudding user response:

validation transaction isolation level mechanism locking with MVCC


  • Related