|
|
The SET USER TIMEOUT statement specifies the amount of time the user
will wait if the requested database resource is unavailable.
ISQL or Application Programs
SET USER TIMEOUT [TO] {{TimeoutValue
:HostVariable}[SECONDS
MINUTES]
DEFAULT
MAXIMUM }
- TimeoutValue
is an integer literal greater than or equal to zero. If the
TimeoutValue is not qualified by MINUTES, SECONDS is
assumed. If representing seconds, TimeoutValue must be in
the range of 0 to 2,147,483,647. If representing minutes,
TimeoutValue must be in the range of
0 to 35,791,394.
- HostVariable
identifies an integer host variable containing a
timeout value.
- DEFAULT
indicates that the user timeout value will be set to the default
timeout value specified by the database administrator.
- MAXIMUM
indicates that the user timeout value will be set to the maximum
timeout value specified by the database administrator.
The value specified by SET USER TIMEOUT remains in effect
only for the duration of the user's session and only affects that
session, and does not modify the value stored in the DBECon
file.
Database resources that may cause a user to wait include the
following:
- Locks
The user attempts to lock a database object that is already
locked by another transaction in a conflicting mode.
- Transaction Slots
The application tries to begin a transaction but the maximum
number of transactions allowed has been reached. ALLBASE/SQL
creates an implicit, brief transaction when the CONNECT
statement is issued.
If the TimeoutValue is zero and the database
resource is unavailable, the user will not wait and an error will
occur. To implement locking with no waiting, set the
TimeoutValue to zero.
The TimeoutValue may not exceed the maximum
timeout value set by the database administrator.
The database administrator may specify the maximum and default
timeout values with the SQLUtil ALTDBE command, or with the following
SQL statements:
START DBE
START DBE NEW
START DBE NEWLOG
You may view the current maximum and default timeout values with
the SQLUtil SHOWDBE command.
The SET USER TIMEOUT statement is not allowed in the
PREPARE statement. A host variable is not permitted if the
SET USER TIMEOUT statement is used in the EXECUTE
IMMEDIATE statement. No section is created for the SET USER
TIMEOUT statement.
An active transaction is not required to execute a SET USER
TIMEOUT statement. An automatic transaction is not started when
a SET USER TIMEOUT statement is executed.
You do not need authorization to use SET USER TIMEOUT.
Examples of setting the user timeout value in seconds:
SET USER TIMEOUT TO 10
SET USER TIMEOUT TO 5 SECONDS
Set user timeout in minutes:
SET USER TIMEOUT 1 MINUTES
When setting the user timeout value to 0, the user will not wait for a database
resource that is unavailable, such as a lock.
SET USER TIMEOUT 0
Set the user timeout value to the default or the maximum value.
SET USER TIMEOUT DEFAULT
SET USER TIMEOUT MAXIMUM
|