Topic group Related topics
Attempts to lock the entire rowset.
The rowset you want to lock.
You may use lockSet( ) to attempt to lock the entire rowset. The rowset cannot be locked if someone else already has any other row or set locks on the rowset.
Set locks are session-based. Once a lockSet( ) attempt succeeds, all other lockSet( ) requests for the same set from rowsets in queries assigned to the same session will succeed. Query objects must be assigned to different Session objects for set locking to work properly.
Locking the rowset is not the same as accessing the table exclusively. Exclusive access means that you are the only one who has the table open. In contrast, locking a rowset allows others to view, but not modify, the rowset.
lockSet( ) returns true to indicate that the lock was successful and false to indicate that it wasn’t.
Set locking support varies among different table types. The Standard (DBF and DB) tables fully support set locking, as do a few SQL servers. For servers that do not support true locks, the Borland Database Engine emulates optimistic locking. Any lock request is assumed to succeed. Later, when the actual attempt to change the data occurs, if the data has changed since the lock attempt, an error occurs.