Software Archive
Read-only legacy content
17061 Discussions

Record Locking with Shared Direct Access Files

Intel_C_Intel
Employee
169 Views
Hi, How do I implement record locking on a fixed length direct access file that is shared between separate processes? The database is a simple stream/binary file located on a central server. The first several bytes have been reserved for use as a record status flag. Each process will open the file with "share=denynone" and will read the record lock status flag and will not perform any write operations and only limited read operations if the indicated record is presently open for writing by another process. Since each application will be executing on a remote host and the file itself will reside on a central server, I would guess that there will be timing issues that need to be handled. Can I implement a simple wait and re-read (or re-read before write) to ensure that the current process has control of that particular record? How else can I implement this? No, SQL is NOT an option.

Thanks
0 Kudos
0 Replies
Reply