Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- db_VISTA III - d_trbegin http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
      D_TRBEGIN

SUMMARY

   d_trbegin(tid)
   cahr *tid;

ARGUMENTS
    tid       Transaction indentification string.

DESCRIPTION

   Function d_trbegin is called to mark the beginning of a new database
   transaction. All database changes made between the call to d_trbegin and
   a subsequent call to d_trend are grouped as a transaction and written to
   the database as unit by function d_trend. Any read locks which were active
   before the call to d_trbegin remain active after the call.

   The transaction id, tid, is a string which identifies or names a
   transaction. The contents of this string is arbitrary. It is intended to be
   used to uniquely indentify each transaction and is to be generated by the
   program. It is passed to the archive logging functions by d_trend to mark
   specific transactions.

CURRENCY CHANGES
   None

RETURN CODES

   -25   S_TRANSID       Transaction id not specified or NULL.

   -26   S_TRACTIVE      Transaction already active. Transactions cannot be
                         nested.

EXAMPLE

   char tr_id[25];   /*transaction id string */
   int  tr_tot =0 ;  /* total number of transactions */
   ..
   sprintf (tr_id,"tr~%d:order entry",++tr_tot);
   d_trbegin(tr_id);
   ..    /* enter customer info */
   ..    /* enter order info */
   ..    /* check invetory */
   if (items_requested > items_ available)
      {
       d_trabort();
       .. /* inform user */
      }
    else
      {
       .. /* complete update */
       d_trend();
      }

See Also: d_trabort d_trend

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson