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 41 def abort self.call("ROLLBACK") self.close end
commit()
click to toggle source
Commit the transaction and return the connection to the connection pool.
# File lib/db/context/transaction.rb, line 29 def commit self.call("COMMIT") self.close end
commit?()
click to toggle source
# File lib/db/context/transaction.rb, line 34 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 52 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 47 def savepoint(name) self.call("SAVEPOINT #{name}") end