Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 9 Transaction Processing : Locks Taken on the Data

Locks Taken on the Data
What Determines the Type of Locking?
The types of accesses that your transaction makes to your data and the mode in which your transaction operates determine the types and levels of locks that are taken on the tables you are accessing. Locks on data are taken only if the transaction is operating in update mode. Locks on table definitions are always taken, regardless of mode.
 
Locking behavior can also be modified using the WITH MINLOCK modifier for the GET statement in the rules language. For details, see GET Statement.
Types of Locks
A lock is either a shared lock or an exclusive lock, as follows:
 
The definition of the table cannot be modified but other transactions operating in update mode can read the data.
The definition of the table cannot be modified and other transactions cannot read or modify the data.
Exception Handling
You can use the LOCKFAIL exception to handle situations where you are unable to obtain a lock. For example, the transaction can require an exclusive lock but another transaction is holding a shared lock. Refer to Chapter 6, Exception Handling for more information about exceptions.
Data Accesses and Types of Locking
The following table describes the locks taken depending on your data access:
 
Mode of Transaction
GET or FORALL using unique (that is, equality) selection on the primary key fields, for example:
GET EMPLOYEES where EMPNO=79912;

GET TESTDATA where PKF1=A & PKF2=B;
GET or FORALL using non-unique selection, for example:
FORALL EMPLOYEES ordered EMPNO:

GET EMPLOYEES where EMPNO>79912;

FORALL EMPLOYEES:
Table instance (if parameterized).
GET using non-unique Selection and WITH MINLOCK, for example:
FORALL EMPLOYEES WHERE SALARY<100000 WITH MINLOCK:
If parameterized: Table instance during GET processing, Occurrence thereafter.
If non-parameterized: Table during GET processing, Occurrence thereafter.
Upgrade shared to exclusive
Browse and/or update
Table instance (if parameterized).
Browsing a CLC (calculation) table (read access on the underlying table)
Table instance (if parameterized).
See Also
TIBCO Service Gateway manuals about table locking as it relates to external databases.
TIBCO Object Service Broker Managing Data about TIBCO Object Service Broker tables and table types.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved