COMMIT

COMMIT

Perform a solid-disk write for all active work areas

Syntax

      COMMIT

Description

COMMIT is a database command that flushes Harbour buffers and performs a solid-disk write for all work areas with open database and index files. The solid-disk write capability is available under DOS version 3.3 and above. Under DOS 3.2 or less, COMMIT flushes Harbour buffers to DOS.

In a network environment, issuing a GO TO RECNO() or a SKIP0 will flush Clipper’s database and index buffers, but only a COMMIT will flush the buffers and perform a solid-disk write. Thus to insure updates are visible to other processes, you must issue a COMMIT after all database update commands (e.g., APPEND, REPLACE). To insure data integrity, COMMIT should be issued before an UNLOCK operation. Refer to the “Network Programming” chapter for more information on update visibility.

Examples

      .  In this example, COMMIT forces a write to disk after a series
        of memory variables are assigned to field variables:
      USE Sales EXCLUSIVE NEW
      MEMVAR->Name := Sales->Name
      MEMVAR->Amount := Sales->Amount
      //
      @ 10, 10 GET MEMVAR->Name
      @ 11, 10 GET MEMVAR->Amount
      READ
      //
      IF UPDATED()
         APPEND BLANK
         REPLACE Sales->Name WITH MEMVAR->Name
         REPLACE Sales->Amount WITH MEMVAR->Amount
         COMMIT
       ENDIF

Seealso

DBCOMMIT(), DBCOMMITALL(), GO, SKIP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.