LockType Property (Remote Data)

       

Returns or sets a Long integer value indicating the type of concurrency handling.

Syntax

object.LockType [= value]

The LockType property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A constant or Long value as described in Settings.

Settings

The settings for value are:

Constant Value Description
rdConcurReadOnly 1 (Default) Cursor is read-only. No updates are allowed.
rdConcurLock 2 Pessimistic concurrency.
rdConcurRowVer 3 Optimistic concurrency based on row ID.
rdConcurValues 4 Optimistic concurrency based on row values.
rdConcurBatch 5 Optimistic concurrency using batch mode updates. Status values returned for each row successfully updated.

Remarks

In order to maintain adequate control over the data being updated, RDO provides a number of concurrency options that control how other users are granted, or refused access to the data being updated. In many cases, when you lock a particular row using one of the LockType settings, the remote engine might also lock the entire page containing the row. If too many pages are locked, the remote engine might also escalate the page lock to a table lock to improve overall system performance.

Not all lock types are supported on all data sources. For example, for SQL Server and Oracle servers using the rdUseODBC cursor library, static-type rdoResultset objects can only support rdConcurValues or rdConcurReadOnly.

If the concurrency option is not supported by the data source, the driver substitutes a different concurrency option at execution time if one is available. If the driver cannot substitute a suitable alternative concurrency option, a trappable error is fired (SQLState Code 01S02 "Option Value Changed"). For rdConcurValues, the driver substitutes rdConcurRowVer and vice versa. For rdConcurLock, the driver substitutes, in order: rdConcurRowVer or rdConcurValues.

Choosing a Concurrency Option

Note   RDO concurrency does not function as it does with Data Access Objects (DAO). Be sure to review the following sections to determine the best type of concurrency control for your application.

The LockType property supports three types of optimistic concurrency as described below. When using the Optimistic Batch Concurrency option (rdConcurBatch), you should also set the UpdateCriteria property to choose an appropriate update concurrency option.