oracle-enhanced icon indicating copy to clipboard operation
oracle-enhanced copied to clipboard

Add optional argument to reconnect for Rails 7.1+ compatibility

Open wojtha opened this issue 8 months ago • 1 comments

This PR fixes #2432

ActiveRecord.connection.verify! fails on Rails 7.1.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 https://github.com/rails/rails/pull/44573 and it appeared in Rails 7.1.0beta1 for the first time.

Oracle Enhanced Driver Implementation

https://github.com/rsim/oracle-enhanced/blob/d5b3daf8bdac7578055467329bcb6600114ea47a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L470-L475

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

wojtha avatar Apr 25 '25 13:04 wojtha

Thank you, this helped me with an issue I was having with #2425

ddalcino avatar Jun 03 '25 23:06 ddalcino

Related to https://github.com/rails/rails/pull/44573

yahonda avatar Jun 13 '25 08:06 yahonda