Problem is that at same time multiple request coming to fetch record from X table and I want to when first record fetch from table then this record lock for another request otherwise same record fetched by all request.
What? Don’t you use authentication and authorization. I have never had a need to lock anything. Explain more what the exact problem is.
If you go to google and search cakephp and I go to google and search cakephp, google does not lock anything.
Ensure the record belongs to owner through authentication and authorization.