Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wojtha opened this issue Apr 25, 2025 · 0 comments · May be fixed by #2433
Open

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

wojtha opened this issue Apr 25, 2025 · 0 comments · May be fixed by #2433

Comments

@wojtha
Copy link

wojtha commented Apr 25, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant