Skip to content

Commit 6756abc

Browse files
authored
Merge pull request #1745 from yahonda/use_cursor_sharing_force
Use cursor_sharing = force by default again
2 parents bfe4b47 + f2ab702 commit 6756abc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/active_record/connection_adapters/oracle_enhanced/jdbc_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def new_connection(config)
150150
# @raw_connection.setDefaultRowPrefetch(prefetch_rows) if prefetch_rows
151151
end
152152

153-
cursor_sharing = config[:cursor_sharing]
153+
cursor_sharing = config[:cursor_sharing] || "force"
154154
exec "alter session set cursor_sharing = #{cursor_sharing}" if cursor_sharing
155155

156156
# Initialize NLS parameters

lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def self.new_connection(config)
285285
privilege = config[:privilege] && config[:privilege].to_sym
286286
async = config[:allow_concurrency]
287287
prefetch_rows = config[:prefetch_rows] || 100
288-
cursor_sharing = config[:cursor_sharing]
288+
cursor_sharing = config[:cursor_sharing] || "force"
289289
# get session time_zone from configuration or from TZ environment variable
290290
time_zone = config[:time_zone] || ENV["TZ"]
291291

spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
expect(ActiveRecord::Base.connection).to be_active
3131
end
3232

33-
it "should use database default cursor_sharing parameter value exact by default" do
33+
it "should use database default cursor_sharing parameter value force by default" do
3434
# Use `SYSTEM_CONNECTION_PARAMS` to query v$parameter
3535
ActiveRecord::Base.establish_connection(SYSTEM_CONNECTION_PARAMS)
36-
expect(ActiveRecord::Base.connection.select_value("select value from v$parameter where name = 'cursor_sharing'")).to eq("EXACT")
36+
expect(ActiveRecord::Base.connection.select_value("select value from v$parameter where name = 'cursor_sharing'")).to eq("FORCE")
3737
end
3838

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

0 commit comments

Comments
 (0)