UltraLite isolation levels

Isolation levels define the degree to which the operations in one transaction are visible to the operations in other concurrent transactions. UltraLite uses the default isolation level read-committed for connections in auto-commit mode. For .NET, read-committed is the default isolation level for new transactions created by calling ULConnection.BeginTransaction without parameters. The default UltraLite isolation level provides the best performance while ensuring data consistency.

With the ReadCommitted isolation level:

  • Dirty reads are prevented
  • No read locks are applied
  • Uncommitted deletes are visible
  • Non-repeatable reads and phantom rows are allowed
  • No guarantee that data will not change during transaction

With the ReadUncommitted isolation level:

  • Dirty reads are allowed
  • No read locks are applied
  • Non-repeatable reads and phantom rows are allowed
  • No guarantee that concurrent transaction will not modify row or roll back changes to row

You can change the isolation level from ReadCommitted to ReadUncommitted. For UltraLite C++, use the SetDatabaseOption method to change the isolation level. For UltraLite.NET 2.0, call the ULConnection.BeginTransaction to create a transaction with the ReadUncommitted isolation level.

Note

For .NET, executing SetDatabaseOption while a transaction is active is not recommended. It changes the isolation level of the connection, but does not update the ULTransaction.IsolationLevel.

Do not use SetDatabaseOption to change the isolation while a transaction is in progress; unpredictable results might occur.


Isolation level side effects