NWLockPhysicalRecordSet

Locks all records logged in the physical record log table

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Synchronization

Syntax

  #include <nwfile.h> 
  or 
  #include <nwcalls.h> 
   
  N_EXTERN_LIBRARY( NWCCODE )NWLockPhysicalRecordSet  ( 
     nuint8    lockFlags,  
     nuint16   timeOut);
  

Delphi Syntax

  uses calwin32 
   
  Function NWLockPhysicalRecordSet 
    (lockFlags : nuint8; 
     timeOut : nuint16 
  ) : NWCCODE;
  

Parameters

lockFlags
(IN) Specifies the lock flags.
timeOut
(IN) Specifies the length of time the NetWare server attempts to lock the record set before timing out.

Return Values

These are common return values; see Return Values (NDK: Connection, Message, and NCP Extensions) for more information.

0x0000

SUCCESSFUL

0x89FE

TIMEOUT_FAILURE

Remarks

A physical record lock, as opposed to a logical lock, is the actual lock of a specified record relative to a physical file. Before a record is locked, it is also entered in the File Log Table at the NetWare server. Records can be locked only if all records in the log table are available for locking. This avoids deadlock.

To avoid deadlock, request those resources needing to be locked by making an entry in the File Log Table at the NetWare server. Once the log table is complete, NWLockPhysicalRecordSet attempts to lock those records. The locking only works 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.

timeOut is specified in units of 1/18 second (0 = no wait).

lockFlags is interpreted as follows:

  0x00   Lock records with exclusive lock 
  0x02   Lock records with shareable lock
  

A shareable lock prevents any process, including the one which made the lock, from writing to the record.

NWLockPhysicalRecordSet cannot lock a record that is already locked exclusively by another application. If one or more records, identified in the log table, are already exclusively locked by another application, the attempt to lock the set fails.

NCP Calls

See Also

NWClearPhysicalRecord, NWClearPhysicalRecordSet, NWLogPhysicalRecord, NWReleasePhysicalRecord, NWReleasePhysicalRecordSet