Module: Txray::Runtime::TransactionTimer

Defined in:
lib/txray/runtime.rb

Instance Method Summary collapse

Instance Method Details

#within_new_transactionObject



193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/txray/runtime.rb', line 193

def within_new_transaction(*, **, &)
  return super unless Txray::Runtime.installed?

  Txray::Runtime.open_transaction
  outcome = :commit
  begin
    super
  rescue Exception # rubocop:disable Lint/RescueException
    outcome = :rollback
    raise
  ensure
    Txray::Runtime.close_transaction(outcome)
  end
end