Src/Interps/Ruby/ruby-1.8.6/lib/ruby/1.8/sqlite3/database.rb
# Begins a new transaction. Note that nested transactions are not allowed
# by SQLite, so attempting to nest a transaction will result in a runtime
# exception.
#
# The +mode+ parameter may be either <tt>:deferred</tt> (the default),
# <tt>:immediate</tt>, or <tt>:exclusive</tt>.
#
# If a block is given, the database instance is yielded to it, and the
# transaction is committed when the block terminates. If the block
# raises an exception, a rollback will be performed instead. Note that if
# a block is given, #commit and #rollback should never be called
# explicitly or you'll get an error when the block terminates.
#
# If a block is not given, it is the caller's responsibility to end the
# transaction explicitly, either by calling #commit, or by calling
# #rollback.
Begins a new transaction. Note that nested transactions are not allowed
by SQLite, so attempting to nest a transaction will result in a runtime
exception.

The +mode+ parameter may be either :deferred (the default),
:immediate, or :exclusive.

If a block is given, the database instance is yielded to it, and the
transaction is committed when the block terminates. If the block
raises an exception, a rollback will be performed instead. Note that if
a block is given, #commit and #rollback should never be called
explicitly or you'll get an error when the block terminates.

If a block is not given, it is the caller's responsibility to end the
transaction explicitly, either by calling #commit, or by calling
rollback.
Begins a new transaction . Note that nested transactions are not allowed by SQLite so attempting to nest a transaction will result in a runtime exception . The + mode + parameter may be either : deferred ( the default ) : immediate or : exclusive . If a block is given the database instance is yielded to it and the transaction is committed when the block terminates . If the block raises an exception a rollback will be performed instead . Note that if a block is given #commit and #rollback should never be called explicitly or you ' ll get an error when the block terminates . If a block is not given it is the caller ' s responsibility to end the transaction explicitly either by calling #commit or by calling rollback .
def transaction( mode = :deferred )
      execute "begin #{mode.to_s} transaction"
      @transaction_active = true
      if block_given?
        abort = false
        begin
          yield self
        rescue ::Object
          abort = true
          raise
        ensure
          abort and rollback or commit
        end
      end
      true
    end
def transaction ( mode = :deferred ) execute "begin #{mode.to_s} transaction" @transaction_active = true if block_given? abort = false begin yield self rescue :: Object abort = true raise ensure abort and rollback or commit end end true end
Begins a new transaction.
Begins a new transaction .
mode