IBM® Informix® 12.10

Determine transaction success or failure

The access method can register an end-of-transaction callback function to handle the MI_EVENT_END_XACT event, which the database server raises at the end of a transaction.

In that callback function, test the return value of the DataBlade® API mi_transition_type() function to determine the state of the transaction, as follows.
Return value for mi_transition_type() Transaction state
MI_NORMAL_END Successful transaction completion The database server can commit the data.
MI_ABORT_END Unsuccessful transaction completion The database server must roll back the index to its state before the transaction began.
Important: IBM® does not ensure uniform commit or rollback (called two-phase-commit protocol) with data in an external database server. If a transaction partially commits and then aborts, inconsistencies can occur between the database server and external data.

As long as a transaction is in progress, the access method should save each original source record value before it executes a delete or update. For transactions that include both internal and external objects, the access method can include either an end-of-transaction or end-of-statement callback function to ensure the correct end-of-transaction action. Depending on the value that mi_transition_type() returns, the callback function either commits or rolls back (if possible) the operations on the external objects.

If an external transaction does not completely commit, the access method must notify the database server to roll back any effects of the transaction on the state of the virtual index.

For detailed information about the following items, see the IBM Informix DataBlade API Programmer's Guide:
  • Handling state-transitions in a UDR
  • End-of-transaction callback functions
  • End-of-statement callback functions

Send feedback | Examples exchange | Troubleshooting

To find the PDF, see Publications for the IBM Informix 12.10 family of products.
For the release notes, documentation notes, and/or machine notes, see the Release Notes page.
timestamp Release date: March 2013