Working with Multiple Transactions in DSQL
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
- 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
- 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,
- As long as a transaction name parameter is not specified with a
SET TRANSACTIONstatement, it can follow a
PREPAREstatement to modify the behavior of a subsequently named transaction in an
EXECUTE IMMEDIATEstatement. 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.