The concept of "lock" is not limited to a specific language implementation. He feels that it is more appropriate to accompany the multi-threading model.
The shadow of locks will be seen wherever critical resource access is involved. Optimistic locking and pessimistic locking are just two more detailed models of locks. The mysql database is implemented in C language. It also involves multiple threads accessing a data at the same time, two people writing at the same time, one person writing and one reading, two people reading at the same time, etc. So locks are not limited to relational databases.
The concept of "lock" is not limited to a specific language implementation. He feels that it is more appropriate to accompany the multi-threading model.
The shadow of locks will be seen wherever critical resource access is involved. Optimistic locking and pessimistic locking are just two more detailed models of locks. The mysql database is implemented in C language. It also involves multiple threads accessing a data at the same time, two people writing at the same time, one person writing and one reading, two people reading at the same time, etc. So locks are not limited to relational databases.
Concurrent reading and writing of any resource can have "locks".
I’m not sure whether Java multi-threading locks exist