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

Table lock modes are represented by (constant) LockMode objects:

  • LockMode::AccessShare (Acquired by any read operation.)
  • LockMode::RowShare (Acquired for any row-locking operation.)
  • LockMode::RowExclusive (Acquired when data in a table is modified.)
  • LockMode::ShareUpdateExclusive
  • LockMode::Share (Prohibits data changes in the table.)
  • LockMode::ShareRowExclusive (Prohibits data changes and other Share or ShareRowExclusive locks. Used instead of LockMode::Share to prohibit dead locks, where two processes holding share locks want to write to a table.)
  • LockMode::Exclusive (Prohibits anything else than reading from the table.)
  • LockMode::AccessExclusive (Prohibits any other access to the table.)

Methods

by_symbol   inspect   new   to_s  

Constants

AccessShare = new(:access_share, 'ACCESS SHARE MODE', 'AccessShare')
RowShare = new(:row_share, 'ROW SHARE MODE', 'RowShare')
RowExclusive = new(:row_exclusive, 'ROW EXCLUSIVE MODE', 'RowExclusive')
ShareUpdateExclusive = new(:share_update_exclusive, 'SHARE UPDATE EXCLUSIVE MODE', 'ShareUpdateExclusive')
Share = new(:share, 'SHARE MODE', 'Share')
ShareRowExclusive = new(:share_row_exclusive, 'SHARE ROW EXCLUSIVE MODE', 'ShareRowExclusive')
Exclusive = new(:exclusive, 'EXCLUSIVE MODE', 'Exclusive')
AccessExclusive = new(:access_exclusive, 'ACCESS EXCLUSIVE MODE', 'AccessExclusive')

Public Class methods

Returns a LockMode object, matching the given symbol.

Used for generating the constants representing the possible table lock modes.

Public Instance methods

Returns the name of the constant referring to the lock mode.

Returns the SQL string representation of the lock mode.

[Validate]