skip to main content
OpenEdge Data Management: DataServer for ODBC
Programming Considerations : Data-source record locking
 

Data-source record locking

In a DataServer application, an ODBC data source handles all of its own locking issues. ABL locking rules do not apply when you access information from an ODBC data source.
The following table provides data-source-specific comparisons.
Table 6. ABL and data-source locking
ABL
Data source
NO–LOCK
Can support the NO–LOCK option in a manner consistent with Progress when transaction isolation levels are set properly.1, 2
SHARE–LOCK
May support shared locks at the table, page, and record level. However, the scope and duration of Progress and data-source shared locks may differ depending on how data-source cursors behave at a transaction boundary and how isolation levels are set. For more information, see your data-source documentation.
EXCLUSIVE–LOCK
Can support exclusive locks at the table, page, and/or record level, depending on the data source.

1 DB2 UDB does not support an equivalent lock type. In a DB2 UDB application, the NO–LOCK condition option is the equivalent of a SHARE–LOCK option. As a result, you might receive the message "record locked."

2 Sybase supports the NO–LOCK option in a manner consistent with Progress except for indexed columns. Record-level locking remains in effect when you access indexed columns.

Each data source uses locks or optimistic concurrency control automatically to isolate users from each other in a multi-user configuration. Your data source and ODBC driver may provide one or a number of transaction isolation levels. In a multi-user configuration, you can isolate users from each other in your data source by setting the isolation level (if the ODBC driver permits). In your OpenEdge schema holder, use the -Dsrv TXN_ISOLATION,n connection parameter (where n = 1, 2, 4, or 8) to set the isolation level in ODBC. See the Microsoft ODBC Programmer's Reference for more information and the reference manuals provided by your data source vendor for supported isolation levels.
Note: Certain earlier versions of DB2 UDB and Sybase use page-level locking rather than record-level locking. This can affect data access when two or more users attempt to read or update different records that are on the same page. See your data-source documentation for details.
The following table shows the possible –Dsrv TXN_ISOLATION,n values with the respective meaning.
Table 7. TXN_ISOLATION values in the –Dsrv parameter
Value
Meaning
1
Read uncommitted (default)
2
Read committed
4
Repeatable read
8
Serializable
In this section: 
* Share locks
* Exclusive locks
* NO-LOCK
* Locking impact on queries
* Locking examples
* The NO-WAIT option