Hi damu,
In network mode, I want to use the combination of the time when the record is locked and the record number as the cookie, thus the cookie is unique.
System.currentTimeMillis() is not precise enough to make sure your cookie is unique. But, BTW your lock cookie does not need to be unique : just difficult to guess by a malicious coder. Think of Random.nextLong().
Because the lock/unlock is consided only in network mode, I think the lock and unlock methods should be only implemented in RemoteData class, the Data class should only have empty lock/unlock methods like a WindowAdapter, am I right? thus there is a question: what should the lockRecord return, 0?
I agree with Andrew. Your design will be simpler if you keep locking for local access.
Best,
Phil.