Specifying Transaction Names When Using Commit

From InterBase

Go Up to Using COMMIT


To commit changes for transactions other than the default transaction, specify a transaction name as a COMMIT parameter. For example, the following C code fragment starts two transactions using names, and commits them:

. . .
EXEC SQL
BEGIN DECLARE SECTION;
isc_tr_handle TR1, TR2;
EXEC SQL
END DECLARE SECTION;
TR1 = (isc_tr_handle) NULL;
TR2 = (isc_tr_handle) NULL;
. . .
EXEC SQL
SET TRANSACTION NAME TR1;
EXEC SQL
SET TRANSACTION NAME TR2;
. . .
/* do actual processsing here */
. . .
EXEC SQL
COMMIT TRANSACTION TR1;
EXEC SQL
COMMIT TRANSACTION TR2;
. . .
Important:
In multi-transaction programs, transaction names must always be specified for COMMIT except when committing the default transaction.

Advance To: