ctLOKDYN
Alters user-wide default locking mechanisms.
Declaration
NINT ctLOKDYN( LONG action )
Description
Calls to ctLOKDYN() can alter the user-wide lock state where action is one of:
Inside of a transaction, an unlock request on a record behaves differently depending on whether or not the record has been updated. If it has not been updated the unlock request succeeds. If it has been updated, the unlock returns a NO_ERROR, but the lock remains and the sysiocod is set to UDLK_TRN (-3).
The ctLOKDYNtranPersist mode will enable a user-wide state such that the lock persists, even if the record has not been updated. The ctLOKDYNnotranPersist will disable this state. The PUTHDR() ctTRNPERShdr mode toggles the file state. The tranPersist state (whether user-wide or file specific) only affects behavior at the time an unlock request is made. Whether it is on or off at the time the lock is granted does not affect unlock behavior.
The ctLOKDYNlockDefer mode will defer the close of a file, for the user-wide state, if there are locks pending on the file, whether or not any records are updated. ctLOKDYNnolockDefer turns off this state. The PUTHDR() ctLOCKDFRhdr mode is the equivalent file state call.
The user-wide and/or file-specific routines need only be called once. The states persist until the user logs off or the file is closed, respectively. However, they can be turned on and off as the application desires.
Return Values
Value |
Symbolic Constant |
Explanation |
---|
See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.