add nested transaction with savepoints

This commit is contained in:
Brian J. Cardiff 2016-12-13 16:15:25 -03:00
parent 9bde76865e
commit c491bd8962
4 changed files with 243 additions and 3 deletions

View file

@ -68,6 +68,29 @@ class DummyDriver < DB::Driver
super
@rolledback = true
end
protected def create_save_point_transaction(parent, savepoint_name : String)
DummySavePointTransaction.new(parent, savepoint_name)
end
end
class DummySavePointTransaction < DB::SavePointTransaction
getter committed = false
getter rolledback = false
def initialize(parent, savepoint_name)
super(parent, savepoint_name)
end
def commit
super
@committed = true
end
def rollback
super
@rolledback = true
end
end
class DummyStatement < DB::Statement