I see that in your implementation it's possible to lock a deleted record because the check if record is valid and the lockmanager.lock call are not 1 atomic operation.
Alecsandru Cocarla wrote:Do you have a Data singleton?
Alecsandru Cocarla wrote:Which methods exactly do you have synchronized?
Alecsandru Cocarla wrote:If yes, then this means your locking mechanism (the lock manager) is useless, since anyway lock/update/unlock are already thread safe. I don't really see why you would synchronize your methods, since lock() is supposed to take care of this.
In my implementation all methods are marked synchronized, so when lock is called and record is valid a RNFE being thrown by read/update/unlock could never happen.
Alecsandru Cocarla wrote:
And, again, sorry for the misunderstanding...