Concurrency and Consistency

While the current user is modifying data, another user may also be reading or modifying the same data. To prevent conflicts, you need to understand data access concurrency and data consistency concepts.

Different solutions exists to manage data concurrency and consistency, depending on the features of the database engines to be supported.

The rules to keep in mind are the following:
  • Use the "committed read" transaction isolation level in order to read only valid data:
    SET ISOLATION LEVEL TO COMMITTED READ
    Committed read is usually the default with most database engines.
  • Set the lock mode to wait for others to release the locks acquired during a transaction:
    SET LOCK MODE TO WAIT
    Important:

    This feature is not supported by all databases engines. When possible, the database driver sets the corresponding connection parameter to define the lock timeout. If the database server does not support setting the lock timeout parameter, the runtime system generates an exception. When the database engine does not support this feature, the default lock mode is usually to wait.

Go to Database transactions in the Genero Business Development Language User Guide for a more complete discussion.

The SQL Database Guides in the Genero Business Development Language User Guide provide detailed information about the behavior of specific database servers.