Skip to content

ActiveRecord.connection.verify! fails on Rails 7.1.0+ when reconnection is needed #2432

@wojtha

Description

@wojtha

ActiveRecord.connection.verify! fails on Rails 7.1.0+ with ArgumentError: wrong number of arguments (given 1, expected 0) when reconnection is needed, because Rails 7.1 added an optional argument restore_transactions: false to the #reconnect! method which is used e.g. inside the #verify!.

This change has been implemented in rails/rails#44573 and it appeared in Rails 7.1.0beta1 for the first time.

Oracle Enhanced Driver Implementation

def reconnect! # :nodoc:
super
_connection.reset!
rescue OracleEnhanced::ConnectionException => e
@logger.warn "#{adapter_name} automatic reconnection failed: #{e.message}" if @logger
end

Rails 7.1.0beta1 Implementation

https://github.com/rails/rails/blob/2d7bc98897053658ad904b12e5b19a52b8cc3617/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L560-L565

Rails 7.1.5.1 Implementation

https://github.com/rails/rails/blob/14c115b120ed089331ff3dc13f36bd9129ced33d/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L680-L712

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions