def execute(result)
      if ActiveRecord::Base.connection.open_transactions >= 1
        super(result)
      else
        result.info('start_transaction')
        ActiveRecord::Base.transaction do
          super(result)
          if result.ok?
            result.info('end_transaction')
          else
            result.info('rollback_transaction')
            raise ActiveRecord::Rollback, 'rollback transaction'
          end
        end
      end
    end
def execute(result)
      if ActiveRecord::Base.connection.open_transactions >= 1
        super(result)
      else
        result.info('start_transaction')
        ActiveRecord::Base.transaction do
          super(result)
          if result.ok?
            result.info('end_transaction')
          else
            result.info('rollback_transaction')
            raise ActiveRecord::Rollback, 'rollback transaction'
          end
        end
      end
    end
starts a transaction only if we are not already within one.