Class FlexiRecord::IsolationLevel
In: lib/flexirecord.rb
Parent: Object

Transaction isolation levels are represented by (constant) IsolationLevel objects:

  • IsolationLevel::ReadUncommitted (Data written by concurrent uncommitted transactions may be read.)
  • IsolationLevel::ReadCommitted (Only data, which has been committed by other transactions is read.)
  • IsolationLevel::RepeatableRead
  • IsolationLevel::Serializable (The first query inside a transaction generates a "snapshot" of the database, which is then used for following read accesses.)

Methods

<=>   by_symbol   inspect   new   to_i   to_s  

Included Modules

Comparable

Constants

ReadUncommitted = new(0, :read_uncommitted, 'READ UNCOMMITTED', 'ReadUncommitted')
ReadCommitted = new(1, :read_committed, 'READ COMMITTED', 'ReadCommitted')
RepeatableRead = new(2, :repeatable_read, 'REPEATABLE READ', 'RepeatableRead')
Serializable = new(3, :serializable, 'SERIALIZABLE', 'Serializable')

Public Class methods

Returns an IsolationLevel object, matching one of these symbols:

  • :read_uncommitted
  • :read_committed
  • :repeatable_read
  • :serializable

Used for generating the 4 constants representing the possible isolation levels.

Public Instance methods

Compares the isolation level with another. (Isolation levels providing fewer isolation are considered smaller.)

Returns the name of the constant referring to the isolation level.

Returns an integer representing the isolation level, which is also used for comparing/ordering them.

Returns the SQL string representation of the isolation level.

[Validate]