ARGUMENTS dbn (optional)The number of the database containing the record
DESCRIPTION Function d_rlbclr is called to clear the record lock bit of the current record. After a record occurrene is locked, the record will remain locked until function d_rblcr is called to clear the lock bit.If d_rldclr is called from within a transaction ,the data file which contains the current record must be write-locked.User error S_NOTLOCKED is returned if the function is called within atransaction and the datafile of a current record is not write-locked.The clearing of record lock bit cannot be applied until the transaction ends because other modifications to be to the record are unusually involved in the transaction.If d_trabort is called after d_rlbclr, the clear is aborted and the record remains lockod.The lock bit is clear througth the cache rather than directly to the file when d_rldclr is called within a transaction.If d_rlbclr is called outside of a transaction, the file does not need to be locked and the operation will directly clear the lock bit on the file.This is used to clear the lock bit on the file.This is used to clear alock after it has been determined that the record no longer needs to update.
The db_VISTA runtime does not provide any automatic protection against charged to records that have the lock bit set.Itis the responsibility of the application program to ensure that the record lock bit is first checked before updating a record.
No records have which have been locked by the program should remain locked after the database is closed.The Database Consistency utility, dbcheck, cande used to report all record occurrences which have the lock bit set.
This function is present in the single user version of db_VISTA, but performs no action.This allows multi-user applications to link with the single user version for operation on stand-alone computer.
-24 S_NOTLOCKED Current record's file is not write-locked.
EXAMPLE /*fetch record to be modified*/ ... if(d_rblset()!=S_OKEY) /* unable to access record*/ ... else{ /*display record and allow user to edit it*/ ... d_trbegin("mod"); while(d_reclock(REC,"w")==S_UNAVAIL) ;/*wait for file's become available */ d_recwrite(&rec); /*update record*/ d_rlbclr(); /*unlock record*/ d_trend(); /*end transaction*/ }