LockLevel
Specifies whether the connection should use row-level locking (value = 0) or database-level locking (value = 1).
By default, TimesTen enables row-level locking for maximum concurrency. With row-level locking, transactions usually obtain locks on the individual rows that they access, although a transaction may obtain a lock on an entire table if TimesTen determines that doing so would result in better performance. Row-level locking is the best choice for most applications, as it provides the finest granularity of concurrency control. To use row-level locking, applications must set the LockLevel
connection attribute to 0 (the default value). To cache Oracle database tables, you must set row-level locking. To CREATE
, DROP
, or ALTER
a user, you can only use row-level locking and thus, the lock level must be set to 0 before you can perform any of these operations.
To give every transaction in this connection exclusive access to the database, you can enable database-level locking by setting the LockLevel
attribute to 1. Doing so may improve performance for some applications.
A connection can change the desired lock level at any time by calling the ttLockLevel
built-in procedure. Connections can also wait for unavailable locks by calling the ttLockWait
built-in procedure. Different connections can coexist with different levels of locking, but the presence of even one connection doing database-level locking leads to loss of concurrency. To display a list of all locks on a particular database you can use the ttXactAdmin
utility.
When using PL/SQL in your applications, set LockLevel
=0 and selectively change to database level locking for specific transactions that require that level of locking by using the ttLockLevel
built-in procedure.
Required Privilege
ADMIN
privilege is required if the value of this attribute is 1.
Usage in TimesTen Scaleout and TimesTen Classic
This attribute is supported in both TimesTen Classic and TimesTen Scaleout.Setting
Set LockLevel
as follows:
Where to set the attribute | How the attribute is represented | Setting |
---|---|---|
C or Java programs or UNIX and Linux systems |
|
|
Windows ODBC Data Source Administrator |
Not applicable |