adspace
How do you implement the locking functionality of records in apex ?
Answer Posted / Ajit Puniya
In Apex, you can use Database.Lock() method to implement record locking. This allows you to acquire a write lock on a specific record, preventing other transactions from modifying it until the lock is released. To acquire a lock, call Database.Lock(Id recordId, LockType type) and specify the Id of the record and the desired lock type.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers