Change the isolation level

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. The default UltraLite isolation level aids data consistency by isolating uncommitted rows.

This isolation level... Has these characteristics...
0—read uncommitted
  • Allow dirty reads, non-repeatable reads, and phantom rows.

  • No guarantee that concurrent transactions will not modify row or roll back changes to rows

1—read committed
  • Allow non-repeatable reads and phantom rows

  • Prevent dirty reads

  • No guarantee that query results will not change during transactions

You can change the isolation level from read_committed to read_uncommitted using one of following approaches:

  • Use the SET OPTION SQL statement and the isolation_level database option.

  • For the UltraLite C++ API, use the ULConnection.SetDatabaseOption method to change the isolation level.

    For the UltraLite.NET API, use the ULConnection.BeginTransaction or ULDatabaseSchema.SetDatabaseOption methods to create a transaction with the read_committed isolation level.

    For the UltraLiteJ API, use the Connection.setOption method.

    Note

    UltraLite Java edition databases only support the read_uncommitted isolation level. See Data synchronization on a BlackBerry smartphone.

 Concurrency and locking for UltraLite Java edition databases
 See also

Characteristics of the read_uncommitted isolation level