Informix® and Microsoft™ SQL SERVER handle
transactions in a similar manner.
Informix native mode
(non ANSI):
- Transactions are started with BEGIN WORK.
- Transactions are validated with COMMIT WORK.
- Transactions are canceled with ROLLBACK WORK.
- Savepoints can be set with SAVEPOINT name [UNIQUE].
- Transactions can be rolled back to a savepoint with ROLLBACK [WORK]
TO SAVEPOINT [name].
- Savepoints can be released with RELEASE SAVEPOINT name.
- Statements executed outside of a transaction are automatically
committed.
- DDL statements can be executed (and canceled) in transactions.
Microsoft SQL SERVER
supports named and nested transactions:
- Transactions are started with BEGIN TRANSACTION [name].
- Transactions are validated with COMMIT TRANSACTION [name].
- Transactions are canceled with ROLLBACK TRANSACTION [name].
- Savepoints can be placed with SAVE TRANSACTION name.
- Transactions can be rolled back to a savepoint with ROLLBACK TRANSACTION
TO name.
- Savepoints can not be released.
- Statements executed outside of a transaction are automatically
committed (autocommit mode). This behavior can be changed with "SET
IMPLICIT_TRANSACTION ON".
- DDL statements are not supported in transactions blocks.
Transactions in stored procedures: avoid using transactions in
stored procedure to allow the client applications to handle transactions,
according to the transaction model.
Solution
Informix transaction
handling commands are automatically converted to Microsoft SQL SERVER instructions to start,
validate or cancel transactions.
Regarding the transaction control
instructions, the BDL applications do not have to be modified in order
to work with Microsoft SQL
SERVER.
Important: If you want to use savepoints,
do not use the UNIQUE keyword in the savepoint declaration, always
specify the savepoint name in ROLLBACK TO SAVEPOINT, and do not drop
savepoints with RELEASE SAVEPOINT.