Working with Multiple Transactions in DSQL
From InterBase
Go Up to Working with Transactions
In InterBase, DSQL applications can also use multiple transactions, but with the following limitations:
- Programs must be preprocessed with the
gpre -m
switch. - Transaction names must be declared statically. They cannot be defined through user-modified host variables at run time.
- Transaction names must be initialized to zero before appearing in DSQL statements.
- All transactions must be started with explicit
SET TRANSACTION
statements. - No data definition language (DDL) can be used in the context of a named transaction in an embedded program; DDL must always occur in the context of the default transaction,
GDS__TRANS
. - As long as a transaction name parameter is not specified with a
SET TRANSACTION
statement, it can follow aPREPARE
statement to modify the behavior of a subsequently named transaction in anEXECUTE
orEXECUTE IMMEDIATE
statement. This enables a user to modify transaction behaviors at run time.
Transaction names are fixed for all InterBase programs during preprocessing, and cannot be dynamically assigned. A user can still modify DSQL transaction behavior at run time. It is up to the programmer to anticipate possible transaction behavior modification and plan for it. The following section describes how users can modify transaction behavior.