# Tidb Database Pessimistic Lock (Continue...)


![left](./student-guide/diagram/12-pessimistic-locking-07-01.png)
------------------------------------------------------------
TiDB database transaction execution process
- Prewrite operation, first perform a version check, query the latest version of this key in raft-store, that is, commit_ts > start_ts, indicating that other things have submitted the latest data “in advance”, that is, a write conflict occurs, then the transaction rolls back;
- If there is no write conflict, then get whether the current key is locked;
- If it is found that it has been locked by another thing, then verify whether the other thing is locked by the same start time or not, or because of a retry, its own thing is locked; if it is locked by another thing, it will report an abnormal abort;
