ALLBASE/SQL Reference Manual (36216-90216)

Chapter 2 89
Using ALLBASE/SQL
Managing Transactions
selected has been committed to the database. You know that the default isolation level for
a session is RR, but RR does not provide the concurrency you need. At the beginning of the
session, you set the isolation level to RC (read committed) for all transactions in the
session, as follows:
.
.
.
SET SESSION ISOLATION LEVEL RC
.
.
.
Note that each transaction starts implicitly. In this example, there is no need for any
BEGIN WORK statements. However, you might choose to include BEGIN WORK statements to
make your code more readable or to set a different isolation level for a particular
transaction.
SELECT * FROM PurchDB.OrderItems
WHERE VendPartNumber = '2310'
COMMIT WORK
.
.
.
SELECT * FROM PurchDB.Vendors
WHERE VendorNumber = 1234
COMMIT WORK
.
.
.
SELECT * FROM PurchDB.SupplyPrice
WHERE VendorNumber = 1234 AND VendPartNumber = '2310'
COMMIT WORK
.
.
.
For more information on isolation levels, refer to Chapter 5 , “Concurrency Control
through Locks and Isolation Levels,” in this manual.
Transaction Limits and Timeouts
The maximum number of concurrent transactions is determined by the
MaxTransactions
parameter of the DBECon file. Use either the START DBE statement or the SQLUtil ALTDBE
command to set
MaxTransactions
. The SQLUtil SHOWDBE command displays the current
setting of
MaxTransactions
in the DBECon file. If a session attempts to start a
transaction, but the maximum number of concurrent transactions has already been
reached, the new transaction is placed in the throttled wait queue. The transaction must
wait until it reaches the head of the queue and one of the active transactions terminates.
The throttled wait queue is serviced on a first in, first out basis. The transaction priority
parameter of the BEGIN WORK statement determines which transaction is aborted to break
a deadlock, not the transaction's position on the throttled wait queue.
If the transaction is still waiting when its timeout limit is reached, the transaction is