And also, your delete method must use the locking mechanism as well as your update method (note the comments of the lock method in the interface that was provided to you; it says that it locks a record so it can be updated or deleted).
Bob, I'm very grateful for your explanation 'cause I would not have done the "is-record-correctly-locked" check in my delete, update etc. methods - I just did not think of this and would have blindly trusted the caller...
but after I got some deadlocks, I came to this conclusion
By using the locking mechanism, I meant that, before updating or deleting a record, you have to make sure that the client that is going to perform such operation owns the lock of that particular record.