By default, MSSQL doesn't support the type of record and table locking that COBOL expects. For this reason, the Connector implements its own locking method. This is accomplished with the addition of two tables to a database. You choose the database to hold these tables during installation of Acu4GL.
Before using the locking tables, you must execute the included ms_inst.sql script. (See the installation instructions you used from this manual for the exact procedure. You can find them in the Contents.) If you don't perform this step, the first time you try to execute a COBOL program that opens an MSSQL table, error 11, Lock Table Incorrect, occurs.
The first locking table is called AcuLocks1; it holds the record locks. The columns in this table are the
There is a unique index on the DBID, the Table ID, and the Key Value, so that inserts into this table are automatically rejected if another user holds a lock on the row in question. This also gives the DBA the information needed to determine who has locks set, and whether the user in question still has a connection to the server.
The second locking table is called AcuOpenTables1; it holds information about open tables.
The columns in this table are
There are no indices on this table, but there is a trigger, which reject opens that are not allowed based on other users' open modes.
By using these lock tables, Acu4GL is able to support all the types of locking ordinarily supported. No special configuration variables are required.
This method of locking is all that is needed if no applications other than COBOL programs are going to be using Acu4GL for MSSQL. But if your site has other applications that access the MSSQL databases, you must use a method of locking that is inherent to Microsoft SQL Server.
Another method of locking that Microsoft SQL Server supports internally is the result of time stamping and the use of BROWSE MODE (see the discussion of BROWSE MODE in the Microsoft SQL Server Commands Reference Manual). If a table has a timestamp column, the Connector uses browse mode. This allows the server to detect whether another application has modified a record while locked by the server.