Pessimistic Concurrency control is one of the concurrency control to avoid multiple users accessing the same record simultaneously.
In this video I have explained about how to define the Locking in managed way. As it is managed, no behavior implementation is required. Additionally have discussed how to test the locking mechanism.
Optimistic Concurrency control - • How to Define Etag in SAP RAP | Managed Op...
SAP RAP playlist - • Managed Restful ABAP Programming Model (RAP)