Skip to content

Multi-User Command Group

DataFlex provides true multi-user operation. This means that more than one user may access and change the same table concurrently.

Commands

In DataFlex, the table is locked only for the time of the save. Updates are then done on the fresh, safe data. Only those columns that have actually been changed are saved to the record, thus preserving any other changes. This type of multi-user operation is virtually undetectable to the operator, greatly contrasting with a read-time lock.

Types of Multi-User Updates

Multi-user updates are of two basic types: transactional and replacement.

  • Transactional Updates: Generally numeric adds or subtracts from totals in a master record. Since the update is based on the reread (safe) data, updates of totals will always be accurate.

  • Replacement Updates: Changing an address or credit limit does not usually require multi-user interaction but does require that the application not arbitrarily rewrite columns that were not changed, as traditional methods provide. DataFlex keeps track of which columns were changed to avoid overwriting old values with changes made by another user subsequent to the first user's read.

Example Scenario

Here is an example of how this works:

Three users have the inventory part ABC on their screens. The quantity in stock (10) and the description (WIDGET) are shown on each screen.

  • User 1 is invoicing the sale of one widget.
  • User 2 is invoicing a sale of two widgets.
  • User 3 is changing the description to WIDGET, GREEN.

All three users read their identical screens, key their input, and then press save within the same second. Let's say that the actual sequence of saves occurs as follows:

  1. User 1 saves first.
  2. User 2 saves second.
  3. User 3 saves last.

  4. User 1's save will reread the record and find it unchanged. His sale of one widget will then be subtracted from the quantity in stock, and the quantity in stock will be written back as 9.

  5. User 2's save will then take control, reread the record (9 in stock), subtract two, and write back the proper number (7).

  6. User 3's save will then get control, reread the record (with 7 in stock), only update the description, and write it back correctly. All this occurs with speed that is typically imperceptible to any user.

In such a system, replacement privilege to transactionally updated columns should be very carefully limited to responsible, thoroughly trained users. To ensure that two users do not sell quantities in excess of the quantity in stock, the application program should be written to check for amounts sold exceeding quantity in stock and declare an error while rejecting the sale.

The foregoing provisions reduce the time a system or record is locked to the very brief interval actually required for saving a record, instead of the reading and entry speed of the operators. Since one field does not interfere with another and transactional updates are optimally handled, the statement "DataFlex provides transparent multi-user protection to the field level" is amply justified.

See Also