method

within_new_transaction

Importance_0
v4.2.1 - Show latest stable - 0 notes - Class: TransactionManager
within_new_transaction(options = {}) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 186
      def within_new_transaction(options = {})
        transaction = begin_transaction options
        yield
      rescue Exception => error
        rollback_transaction if transaction
        raise
      ensure
        unless error
          if Thread.current.status == 'aborting'
            rollback_transaction if transaction
          else
            begin
              commit_transaction
            rescue Exception
              transaction.rollback unless transaction.state.completed?
              raise
            end
          end
        end
      end
Register or log in to add new notes.