Class DataMapper::Transaction
In: lib/dm-transactions.rb
lib/dm-transactions/adapters/dm-postgres-adapter.rb
lib/dm-transactions/adapters/dm-oracle-adapter.rb
lib/dm-transactions/adapters/dm-mysql-adapter.rb
lib/dm-transactions/adapters/dm-do-adapter.rb
lib/dm-transactions/adapters/dm-sqlserver-adapter.rb
lib/dm-transactions/adapters/dm-sqlite-adapter.rb
Parent: Object

Methods

begin   begin?   commit   commit?   link   method_missing   new   none?   primitive_for   rollback   rollback?   within  

Classes and Modules

Module DataMapper::Transaction::DataObjectsAdapter
Module DataMapper::Transaction::Model
Module DataMapper::Transaction::MysqlAdapter
Module DataMapper::Transaction::OracleAdapter
Module DataMapper::Transaction::PostgresAdapter
Module DataMapper::Transaction::Repository
Module DataMapper::Transaction::Resource
Module DataMapper::Transaction::SqliteAdapter
Module DataMapper::Transaction::SqlserverAdapter

Attributes

state  [RW]  @api private

Public Class methods

Create a new Transaction

@see Transaction#link

In fact, it just calls link with the given arguments at the end of the constructor.

@api public

Public Instance methods

Begin the transaction

Before begin is called, the transaction is not valid and can not be used.

@api private

@api private

Commit the transaction

  If no block is given, it will simply commit any changes made since the
  Transaction did #begin.

@param block<Block> a block (taking the one argument, the Transaction) to

  execute within this transaction. The transaction will begin and commit
  around the block, and roll back if an exception is raised.

@api private

@api private

Associate this Transaction with some things.

@param [Object] things

  the things you want this Transaction associated with:

  Adapters::AbstractAdapter subclasses will be added as
    adapters as is.
  Arrays will have their elements added.
  Repository will have it's own @adapters added.
  Resource subclasses will have all the repositories of all
    their properties added.
  Resource instances will have all repositories of all their
    properties added.

@param [Proc] block

  a block (taking one argument, the Transaction) to execute within
  this transaction. The transaction will begin and commit around
  the block, and rollback if an exception is raised.

@api private

@api private

Rollback the transaction

Will undo all changes made during the transaction.

@api private

@api private

Execute a block within this Transaction.

No begin, commit or rollback is performed in within, but this Transaction will pushed on the per thread stack of transactions for each adapter it is associated with, and it will ensures that it will pop the Transaction away again after the block is finished.

@param block<Block> the block of code to execute.

@api private

[Validate]