The Default Transaction

From InterBase
Jump to: navigation, search

Go Up to Working with Multiple Transactions


In multi-transaction programs, it is good programming practice to supply a transaction name for every transaction a program defines. One transaction in a multi-transaction program can be the default transaction, GDS__TRANS. When the default transaction is used in multi-transaction programs, it, too, should be started explicitly and referenced by name in data manipulation statements.

If the transaction name is omitted from a transaction management or data manipulation statement, InterBase assumes the statement affects the default transaction. If the default transaction has not been explicitly started with a SET TRANSACTION statement, gpre inserts a statement during preprocessing to start it.

Important: DSQL programs must be preprocessed with the gpre -m switch. In this mode, gpre does not generate the default transaction automatically, but instead reports an error. DSQL programs require that all transactions be explicitly started.