Informix® and MySQL 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.
MySQL:
- Transactions are started with START TRANSACTION.
- Transactions are validated with COMMIT [WORK].
- Transactions are canceled with ROLLBACK [WORK].
- Savepoints can be placed with SAVEPOINT name.
- 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.
Solution
Informix transaction
handling commands are automatically converted to MySQL instructions
to start, validate or cancel transactions.
MySQL does not support
transactions by default. You must set the server system parameter table_type=InnoDB.
Regarding
the transaction control instructions, the BDL applications do not
have to be modified in order to work with MySQL, as long as you have
a transaction manager installed with MySQL.
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.