Record locking in DataFlex occurs at the file level. This means that when a lock is required, the entire file must be locked, not just a single record. Because of this limitation, locking of records must be considered carefully when accessing DataFlex files.
Locking occurs automatically during updates or deletions of records through the use of UPDATE or DELETE SQL statements.
If data is selected with the intention of updating it through the use of the SELECT ___ FOR UPDATE SQL statement, or by setting the SQL_CONCUR_LOCK property of the statement handle, then CONNX will return an error if an attempt is made to read a table locked by another user.
Record locking in DataFlex files can be triggered by setting the lock property of the statement handle to SQL_CONCUR_LOCK when issuing an SELECT statement.
Implementation of this feature varies in each product.
Here is an example of an SQL statement used for DataFlex record locking in Visual Basic ADO:
rs.Open "select customerid from customers_dataflex", conn, adOpenKeyset, adLockPessimistic
Transactions are not supported by CONNX for DataFlex.