Collection Contents Previous Next PDF

UltraLite.NET User's Guide

Understanding UltraLite.NET Development

Transaction processing in UltraLite


UltraLite provides transaction processing to ensure the integrity of the data in your database. A transaction is a logical unit of work. Either an entire transaction is executed or none of the statements in the transaction are executed.

By default, UltraLite.NET operates in autocommit mode, so that each insert, update, or delete is executed as a separate transaction. Once the operation is complete, the change is made to the database.

To use multi-statement transactions, you must create a ULTransaction class object by calling ULConnection.BeginTransaction(). For example, if your application transfers money between two accounts, either both the deduction from the source account and the addition to the destination account must be completed, or neither statement must be completed.

If the connection has a valid transaction, you must execute a ULTransaction.Commit() statement to complete the transaction and make changes to your database permanent, or you must execute a ULTransaction.Rollback() statement to cancel all the operations of the transaction. Once a transaction has been commited or rolled back, the connection will revert to autocommit mode until the next call to ULConnection.BeginTransaction().

For more information, see ULConnection class and ULTransaction class (iAnywhere.Data.UltraLite namespace) or Connection class (iAnywhere.UltraLite namespace).


Collection Contents Previous Next PDF