Displaying 1 result from an estimated 1 matches for "database_transaction_rollback".
2006 Jun 15
4
testing with transactions
...epoint_open = false
savepoint_name = nil
begin
if block_given?
if start_db_transaction
begin_db_transaction
transaction_open = true
else
savepoint_name = create_savepoint
savepoint_open = true
end
yield
end
rescue Exception => database_transaction_rollback
if transaction_open
transaction_open = false
rollback_db_transaction
end
if savepoint_open
savepoint_open = false
rollback_to_savepoint(savepoint_name)
end
raise
end
ensure
commit_db_transaction if transaction_open
release_savepoint(savepoint_name)...