Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def reconnect
end

# Reconnects to the database.
def reconnect! # :nodoc:
def reconnect!(restore_transactions: false) # :nodoc:
super
_connection.reset!
rescue OracleEnhanced::ConnectionException => e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
expect(ActiveRecord::Base.connection).to be_active
end

it "should be active after reconnection to database with restore_transactions: true" do
ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
ActiveRecord::Base.connection.reconnect!(restore_transactions: true)
expect(ActiveRecord::Base.connection).to be_active
end

it "should use database default cursor_sharing parameter value force by default" do
# Use `SYSTEM_CONNECTION_PARAMS` to query v$parameter
ActiveRecord::Base.establish_connection(SYSTEM_CONNECTION_PARAMS)
Expand Down