Class: Audrey::Engine::SQLite3::Transaction::RC
- Inherits:
-
Audrey::Engine::SQLite3::Transaction
- Object
- Transaction
- Audrey::Engine::SQLite3::Transaction
- Audrey::Engine::SQLite3::Transaction::RC
- Defined in:
- lib/audrey/engine/sqlite3.rb
Overview
Audrey::Engine::SQLite3::Transaction::RC An object of this class represents a transaction that can be rolled back or committed.
Instance Attribute Summary collapse
-
#savepoint ⇒ Object
readonly
Returns the value of attribute savepoint.
Instance Method Summary collapse
-
#commit ⇒ Object
————————————————————————— commit.
-
#initialize(*opts) ⇒ RC
constructor
————————————————————————— initialize.
-
#rollback ⇒ Object
————————————————————————— rollback.
-
#start ⇒ Object
————————————————————————— start.
-
#terminate ⇒ Object
————————————————————————— terminate.
Methods inherited from Transaction
Constructor Details
#initialize(*opts) ⇒ RC
initialize
1237 1238 1239 1240 |
# File 'lib/audrey/engine/sqlite3.rb', line 1237 def initialize(*opts) super(*opts) start() end |
Instance Attribute Details
#savepoint ⇒ Object (readonly)
Returns the value of attribute savepoint.
1232 1233 1234 |
# File 'lib/audrey/engine/sqlite3.rb', line 1232 def savepoint @savepoint end |
Instance Method Details
#commit ⇒ Object
commit
1261 1262 1263 1264 |
# File 'lib/audrey/engine/sqlite3.rb', line 1261 def commit release() @engine.reset_savepoints self end |
#rollback ⇒ Object
rollback
1273 1274 1275 |
# File 'lib/audrey/engine/sqlite3.rb', line 1273 def rollback @engine.dbh.execute "rollback to #{@savepoint}" end |
#start ⇒ Object
start
1249 1250 1251 1252 |
# File 'lib/audrey/engine/sqlite3.rb', line 1249 def start @savepoint = Audrey::Util.randstr() @engine.dbh.execute "savepoint #{@savepoint}" end |
#terminate ⇒ Object
terminate
1284 1285 1286 1287 |
# File 'lib/audrey/engine/sqlite3.rb', line 1284 def terminate rollback() release() end |