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 @@ -150,7 +150,7 @@ def new_connection(config)
# @raw_connection.setDefaultRowPrefetch(prefetch_rows) if prefetch_rows
end

cursor_sharing = config[:cursor_sharing]
cursor_sharing = config[:cursor_sharing] || "force"
exec "alter session set cursor_sharing = #{cursor_sharing}" if cursor_sharing

# Initialize NLS parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def self.new_connection(config)
privilege = config[:privilege] && config[:privilege].to_sym
async = config[:allow_concurrency]
prefetch_rows = config[:prefetch_rows] || 100
cursor_sharing = config[:cursor_sharing]
cursor_sharing = config[:cursor_sharing] || "force"
# get session time_zone from configuration or from TZ environment variable
time_zone = config[:time_zone] || ENV["TZ"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
expect(ActiveRecord::Base.connection).to be_active
end

it "should use database default cursor_sharing parameter value exact by default" do
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)
expect(ActiveRecord::Base.connection.select_value("select value from v$parameter where name = 'cursor_sharing'")).to eq("EXACT")
expect(ActiveRecord::Base.connection.select_value("select value from v$parameter where name = 'cursor_sharing'")).to eq("FORCE")
end

it "should use modified cursor_sharing value force" do
ActiveRecord::Base.establish_connection(SYSTEM_CONNECTION_PARAMS.merge(cursor_sharing: :force))
expect(ActiveRecord::Base.connection.select_value("select value from v$parameter where name = 'cursor_sharing'")).to eq("FORCE")
it "should use modified cursor_sharing value exact" do
ActiveRecord::Base.establish_connection(SYSTEM_CONNECTION_PARAMS.merge(cursor_sharing: :exact))
expect(ActiveRecord::Base.connection.select_value("select value from v$parameter where name = 'cursor_sharing'")).to eq("EXACT")
end
end

Expand Down