ContentsIndexPreviousNext

A-DBM-LOCK-METHOD

Use this variable to specify the locking method that the Acu4GL product should use when accessing your data source. Possible values are:

none
SETPOS
SETSTMTOPTION
UPDATECOLUMN

Example:

A-DBM-LOCK-METHOD UPDATECOLUMN

The default value is UPDATECOLUMN.


Note: If you really don't want to use record locking, then you can use the value of NONE. This variable describes what the Acu4GL product does to try to lock records. NONE means that it does nothing special. UPDATECOLUMN means that after a "fetch" (a read of some type) the row is artificially updated (not actually changing any data) in order for the record to be locked. It is at this point that the DBMaker lock logic comes into play. When a record is updated, it is locked until the connection explicitly unlocks it (or a transaction is committed or rolled back.)
Please note that we cannot guarantee that setting this variable will have any effect for a particular DBMaker driver. Locking depends mainly on the data source and the driver. You can use this variable to attempt to induce row locking. If none of the settings cause any rows to be locked, or if the machine hangs, please report this behavior to Acucorp Technical Support.

SETPOS

Specify SETPOS as your lock method to tell Acu4GL for DBMaker to perform the following locking sequence:

1. When setting up a statement handle for accessing the DBMaker data source, the Acu4GL product calls a function called SQLSetScrollOptions, with values (SQL-CONCUR-LOCK, SQL-SCROLL-KEYSET-DRIVER, 1).

2. When fetching rows from the data source, the Acu4GL product calls SQLExtendedFetch instead of SQLFetch.

3. Finally, it calls SQLSetPos, with the values (1, SQL-POSITION, SQL-LOCK-EXCLUSIVE).

If any of these functions do not exist in the DBMaker driver, then A-DBM-LOCK-METHOD reverts to none.


Note: Even if these functions do exist, there is no guarantee that any rows will be locked using this sequence of calls. Contact your driver vendor to determine whether or not this sequence will be effective for your data source.
SETSTMTOPTION

Specify SETSTMTOPTION as your lock method for DBMaker version 3.0 (and later) drivers. This option is similar to SETPOS except that it has more functionality.

In particular, when using this method of locking, the Acu4GL product will call SQLSetStmtOption a number of times, with values (SQL-CONCURRENCY, SQL-CONCUR-LOCK), (SQL-CURSOR-TYPES, SQL-CURSOR-KEYSET-DRIVEN), and (SQL_KEYSET-SIZE, 1). Again, if the function does not exist, then A-DBM-LOCK-METHOD reverts to none.

UPDATECOLUMN

Specifying UPDATECOLUMN as your lock method performs an entirely different type of locking. Instead of trying to lock a row while reading it, this method creates a new statement handle for the data source. Then, after fetching the data from the data source, it resubmits an SQL query to select the same row (based on the primary key) and adds an UPDATE clause. Last, it fetches the data from the data source. Because this method has the most overhead, it is not recommended for slow drivers such as Microsoft Access, but it is much more likely to succeed in locking records.