NWLogLogicalRecord

Logs a logical record in a 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)NWLogLogicalRecord ( 
     NWCONN_HANDLE       conn,  
     const nstr8 N_FAR  *logRecName,  
     nuint8              lockFlags,  
     nuint16             timeOut);
  

Delphi Syntax

  uses calwin32 
   
  Function NWLogLogicalRecord 
    (conn : NWCONN_HANDLE; 
     const logRecName : pnstr8; 
     lockFlags : nuint8; 
     timeOut : nuint16 
  ) : NWCCODE;
  

Parameters

conn
(IN) Specifies the NetWare server connection handle.
logRecName
(IN) Points to the name of the logical record being logged (128 characters).
lockFlags
(IN) Specifies the lock flags.
timeOut
(IN) Specifies the length of time the NetWare server attempts to lock the record before timing out.

Return Values

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

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x890A

NLM_INVALID_CONNECTION

0x8996

SERVER_OUT_OF_MEMORY

0x89FE

TIMEOUT_FAILURE

0x89FF

LOCK_ERROR

Remarks

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.

NOTE:Locking or unlocking a logical record does not physically lock or unlock those resources associated with the logical record; only the applications using the record know about such an association.

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).

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 needing to be locked 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.

NCP Calls

See Also

NWClearLogicalRecord, NWClearLogicalRecordSet, NWLockLogicalRecordSet, NWReleaseLogicalRecord, NWReleaseLogicalRecordSet