Module RR::Committers
In: lib/rubyrep/committers/buffered_committer.rb
lib/rubyrep/committers/committers.rb

Committers are classes that implement transaction policies. This module provides functionality to register committers and access the list of registered committers. Every Committer needs to register itself with Committers#register. Each Committer must implement at the following methods:

  # Creates a new committer
  #   * session: a Session object representing the current database session
  def initialize(session)

  # Inserts the specified record in the specified +database+ (either :left or :right).
  # +table+ is the name of the target table.
  # +values+ is a hash of column_name => value pairs.
  def insert_record(database, values)

  # Updates the specified record in the specified +database+ (either :left or :right).
  # +table+ is the name of the target table.
  # +values+ is a hash of column_name => value pairs.
  # +old_key+ is a column_name => value hash with the original primary key.
  # If +old_key+ is +nil+, then the primary key must be contained in +values+.
  def update_record(database, values, old_key)

  # Deletes the specified record in the specified +database+ (either :left or :right).
  # +table+ is the name of the target table.
  # +values+ is a hash of column_name => value pairs. (Only the primary key
  # values will be used and must be included in the hash.)
  def delete_record(database, values)

  # Is called after the last insert / update / delete query.
  def finalize

Methods

Classes and Modules

Class RR::Committers::BufferedCommitter
Class RR::Committers::DefaultCommitter
Class RR::Committers::NeverCommitter

Public Class methods

Returns a Hash of currently registered committers. (Empty Hash if no connection committers were defined.)

Registers one or multiple committers. committer_hash is a Hash with

  key::   The adapter symbol as used to reference the committer
  value:: The class implementing the committer

[Validate]