4 Database Manipulation
The DBUNLOCK Statement
DBUNLOCK release all locks for a database or release a specific lock as specified by the qualifier argument.
DBUNLOCK (base name, qualifier, mode, status)
The parameters are:
- base name
- The same string variable identifying the database name when the database was opened.
- qualifier
- Defines which specific lock will be released.
- mode
- A numeric expression equal to 1.
- status
- An integer array variable that returns status information after DBUNLOCK is executed. The array must contain at least ten elements in its right-most dimension.
DBUNLOCK mode relinquishes locks to all sections of the database previously acquired by DBLOCK. If DBUNLOCK is executed at a time when the user does not have a lock, no error is returned.
The following DBUNLOCK mode values are supported:
Mode
UNLOCK Operation
- 1
- Unlock database. All locks for the database are released.
- 3
- Unlock dataset. A lock mode 3/4/13/14 is released. The qualifier argument must match the DBLOCK argument.
- 5
- Unlock predicate. A lock mode 5/6/15/16 is released. The qualifier argument must match the DBLOCK argument.
In addition to the "official" modes above, DBUNLOCK also accepts and translates the following mode values:
Mode 2/11/12 is mapped to 1
Mode 4/13/14 is mapped to 3
Mode 6/15/16 is mapped to 5
This makes it possible to use the same DBLOCK and DBUNLOCK modes.
DBUNLOCK Status Array
A DBUNLOCK error assigns a non-zero conditional word (CW) to the first element of the status array. A list of all CW values and their meanings appears in page 197 . The following table describes the status array contents after a successful DBUNLOCK.
Type of Access
Array Element | Value | Description |
1 | Conditional word | 0 for successful unlock. |
2 through 4 | Unchanged | |
5 | 0 | |
6 | Bits 0 through 11 | The DBUNLOCK identification number 410. |
7 | Program line number | |
8 | 0 | |
9 | Mode number | The mode parameter value. |
10 | Any value | Reserved. |
Conflicting Item lock resolution
The LOCK CONFLICTING ITEM configuration directive makes it possible to configure, how predicate locks with conflicting items are resolved.
Former Eloquence revisions rejected a predicate lock with a conflicting item, because this could lead to a situation, where two processes own a lock on an overlapping subset of data. If LOCK CONFLICTING ITEM is set to 1, predicate locks with conflicting items are granted. However any write attempt to data where another process owns a lock will result in a status error -12.
Please refer to the Eloquence configuration section for further information.
Eloquence Database Manual - 19 DEC 2002