Hi Jiju,
At a functional (or business) level you must provide record level locking according to your instructions - both the explicit instruction you mentioned, and some implicit instructions (regarding concurrent multi user access).
So at a business-logic level, when I am in the process of booking record number 5 (for instance), I need to know that I have the ability to logically lock record number 5 so that no other client can book it. While it is logically locked, I can perform any business logic needed that requires the record to be locked.
As for physically locking the file itself (possibly via the
java.nio.channels.FileLock class, it is worth noting the following warning in the API:
Whether or not a lock actually prevents another program from accessing the content of the locked region is system-dependent and therefore unspecified.
Regards, Andrew