This function ends a database transaction. by writting to the database all changes made since the most recent call to d_trbegin. The changes are first written to user log file in order to support auto recovery and then written to the database. The process in which the changes are written to database is called transaction commit.
All locked files for all open databases are freed by d_trend except exclusive-locked files, which remain exclusive-locked, and keep-locked files, which will remain read-locked after the d_trend call.
────────────────────────────────────────────────────────────────────────── Note: A technique which is useful in dealing which ststus S_NOSPACE is to store on the disk a "threshold" file of some reasonable size, the contents of which are immaterial. Then, when d_trend returns S_NOSPACE, simply delete (unlink) the theshold file and reissure the call to d_trend. db_VISTA will reprwcess and complete the transaction, assuming of course there is now enought disk space available (see sxample below). ──────────────────────────────────────────────────────────────────────────
CURRENCY CHANGES None
RETURN CODES
-27 S_TRNOTACT Transaction not active, There is no active transaction to end.
-900 S_NOSPACE No more space on file (disk).
EXAMPLE
d_trbegin("orderentry"); .. /* enter order info */ if ( d_trend() == NO_SPACE ) { unlink("thrshold.sav"); .. /* inform user that disk space is low */