#include<nwfile.h> or #include<nwcalls.h>NWCCODE N_API NWLogLogicalRecord (NWCONN_HANDLE conn, pnstr8 logRecName, nuint8 lockFlags, nuint16 timeOut);
A logical record is simply a name (string) registered with the NetWare server. The name (as with a semaphore) can then be locked or unlocked by applications and can be used as an inter-application locking mechanism.
When lockFlags is set to option one or three, the NetWare server attempts to lock the logical record for the length of time specified by timeOut. timeOut is specified in 1/18 second units.
lockFlags' values are the following:
0 = Log only 1 = Log and lock exclusive 3 = Log and lock shareable
timeOut is specified in units of 1/18 second (0 = no wait).
In DOS and Windows, all access to the network is blocked during any time out period. For this reason, time outs should be kept to an absolute minimum -- a value of 18 or less. (Even though DOS is mono-tasking, the application may be running in a DOSBOX under Windows Enhanced Mode.)
Normally, a set of files or records is logged and then locked as a set. However, a single file or record can also be locked when it is placed in the log table. The release functions, NWReleaseLogicalRecord and NWReleaseLogicalRecordSet, are used to unlock a lock (or set of locks). The clear functions, NWClearLogicalRecord and NWClearLogicalRecordSet, are used to unlock and remove a lock (or set of locks) from the log table.
To avoid deadlock, request those resources needed to lock by making an entry in the File Log Table at the NetWare server. Once the log table is complete, NWLogLogicalRecord attempts to lock those records. Locking works only if all records in the table are available. If some of the logged resources cannot be locked, the lock fails and none of the resources are locked.
NWLogLogicalRecord cannot lock files already logged and exclusively locked by other applications.
Synchronization