class DB::Context::Transaction

Public Instance Methods

abort() click to toggle source

Abort the transaction and return the connection to the connection pool.

# File lib/db/context/transaction.rb, line 30
def abort
        self.call("ROLLBACK")
        self.close
end
begin() click to toggle source

Begin a transaction.

# File lib/db/context/transaction.rb, line 12
def begin
        self.connect!
        self.call("BEGIN")
end
commit() click to toggle source

Commit the transaction and return the connection to the connection pool.

# File lib/db/context/transaction.rb, line 18
def commit
        self.call("COMMIT")
        self.close
end
commit?() click to toggle source
# File lib/db/context/transaction.rb, line 23
def commit?
        unless self.closed?
                self.commit
        end
end
rollback(name) click to toggle source

Return back to a previously registered savepoint.

# File lib/db/context/transaction.rb, line 41
def rollback(name)
        self.call("ROLLBACK #{name}")
end
savepoint(name) click to toggle source

Mark a savepoint in the transaction.

# File lib/db/context/transaction.rb, line 36
def savepoint(name)
        self.call("SAVEPOINT #{name}")
end