Dalibor Novak wrote:I am 100% positive that you shouldn't do this. RecordNotFoundException should be thrown if someone tries to lock record that either doesn't exist or is marked as deleted. Hence it's name RecordNotFoundException and not RecordLockedException.
So to put this thing in a short sentence. You suggest that I can allow deadlocks if same client tries to lock the same record more than once.
If I'll do that I'll definitely mention it in javadoc.
Does anyone else have opinion on this?
if the current thread already holds a lock than repeated calls to lock would return immediately.