Documentation

Database Administrator's Guide

Previous Topic

Next Topic

TRAN_TIMEOUT

TRAN_TIMEOUT <interval>

There are occasions where it is valuable to limit the time that a FairCom DB Server transaction is allowed to span. Long held transactions can cause a number of application-related issues. For example, holding locks on a record, or preventing updates to be available to other users in a timely manner.

TRAN_TIMEOUT sets a time limit on a transaction: when a transaction is started, once the time period passes, if the transaction is still active it is aborted regardless of what the user is doing (the user could be idle for example).

  • <interval> is specified in seconds.
  • The minimum value for the timeout <interval> is 10 seconds. Any value between 1 and 10 is the same as 10.
  • If the <interval> is set to 0 (or a negative number), this feature is turned off.

TRAN_TIMEOUT is also useful to avoid increases in the number of active transaction logs which can occur due to a user starting a transaction and then remaining idle without committing the transaction, while other transaction activity occurs. TRAN_TIMEOUT aborting the transaction releases locks acquired within the transaction.

Deferred Transaction Begins

A deferred begin transaction (a transaction started using ctDEFERBEG), only starts counting the transaction time when the transaction is converted to an actual transaction (typically on the first update made in that transaction). For example, if you start isql and do some SELECTS then look at the transaction time shown for the SQL connection by ctadmn, it will show '--' indicating the transaction is not yet an actual transaction (this is because SQL threads use ctDEFERBEG transactions). Once you perform an update, ctadmn will show the transaction time counting, and if TRAN_TIMEOUT is in effect, the transaction will be aborted if it does not commit before the TRAN_TIMEOUT limit.

Transaction Timeout Statistics

The USERINFO() function returns state information for a particular connection to the FairCom DB Server. Included in the state information is the elapsed transaction time for that connection. When a transaction is started with the ctDEFERBEG mode, the elapsed transaction time value returned by USERINFO() is based on the time at which the TRANBEG() call was made.

For a transaction whose begin has been deferred, USERINFO() returns an elapsed transaction time of zero until the transaction begin is converted to an actual transaction begin, at which point the elapsed transaction time is calculated from that time.

Default: No timeout

TOCIndex