activerecord-oracle_enhanced-adapter 6.0.0.rc1 → 6.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb +6 -2
- data/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +2 -0
- data/spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb +28 -0
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdc31c880510cdf6b84f68c710f76cbc32d8819c2509daa0932abb7b5bc61953
|
4
|
+
data.tar.gz: 7b9a581e8f9aad1e49e1d27c1295d36a721d0fef816a6eb30a6a02e60c9c89f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e346ff86f05d843165df5c5b505568a78a6e2fe0b8291cde8cb8608913bc7a8c1a68ca5304d129da9ba51a0781a0d26fc075183283697566023aa0eabb3ee7c5
|
7
|
+
data.tar.gz: a63ee6a2411af0f9743beee488f553318609a8ab19549a8ed54fdc494fda931c01e2bf4a74a293ad2fbda40a7551f7a9c693f504f95e7f9aec77a5a93fbe0b1d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0.0.
|
1
|
+
6.0.0.rc2
|
@@ -297,6 +297,8 @@ module ActiveRecord
|
|
297
297
|
# The OracleEnhancedOCIFactory factors out the code necessary to connect and
|
298
298
|
# configure an Oracle/OCI connection.
|
299
299
|
class OracleEnhancedOCIFactory #:nodoc:
|
300
|
+
DEFAULT_TCP_KEEPALIVE_TIME = 600
|
301
|
+
|
300
302
|
def self.new_connection(config)
|
301
303
|
# to_s needed if username, password or database is specified as number in database.yml file
|
302
304
|
username = config[:username] && config[:username].to_s
|
@@ -326,11 +328,13 @@ module ActiveRecord
|
|
326
328
|
else
|
327
329
|
database
|
328
330
|
end
|
329
|
-
|
331
|
+
|
332
|
+
OCI8.properties[:tcp_keepalive] = config[:tcp_keepalive] == false ? false : true
|
330
333
|
begin
|
331
|
-
OCI8.properties[:tcp_keepalive_time] =
|
334
|
+
OCI8.properties[:tcp_keepalive_time] = config[:tcp_keepalive_time] || DEFAULT_TCP_KEEPALIVE_TIME
|
332
335
|
rescue NotImplementedError
|
333
336
|
end
|
337
|
+
|
334
338
|
conn = OCI8.new username, password, connection_string, privilege
|
335
339
|
conn.autocommit = true
|
336
340
|
conn.non_blocking = true if async
|
@@ -115,6 +115,8 @@ module ActiveRecord
|
|
115
115
|
# * <tt>:time_zone</tt> - database session time zone
|
116
116
|
# (it is recommended to set it using ENV['TZ'] which will be then also used for database session time zone)
|
117
117
|
# * <tt>:schema</tt> - database schema which holds schema objects.
|
118
|
+
# * <tt>:tcp_keepalive</tt> - TCP keepalive is enabled for OCI client, defaults to true
|
119
|
+
# * <tt>:tcp_keepalive_time</tt> - TCP keepalive time for OCI client, defaults to 600
|
118
120
|
#
|
119
121
|
# Optionals NLS parameters:
|
120
122
|
#
|
@@ -135,6 +135,34 @@ describe "OracleEnhancedConnection" do
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
+
if defined?(OCI8)
|
139
|
+
describe "with TCP keepalive parameters" do
|
140
|
+
it "should use database default `tcp_keepalive` value true by default" do
|
141
|
+
ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS)
|
142
|
+
|
143
|
+
expect(OCI8.properties[:tcp_keepalive]).to be true
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should use modified `tcp_keepalive` value false" do
|
147
|
+
ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS.dup.merge(tcp_keepalive: false))
|
148
|
+
|
149
|
+
expect(OCI8.properties[:tcp_keepalive]).to be false
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should use database default `tcp_keepalive_time` value 600 by default" do
|
153
|
+
ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS)
|
154
|
+
|
155
|
+
expect(OCI8.properties[:tcp_keepalive_time]).to eq(600)
|
156
|
+
end
|
157
|
+
|
158
|
+
it "should use modified `tcp_keepalive_time` value 3000" do
|
159
|
+
ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS.dup.merge(tcp_keepalive_time: 3000))
|
160
|
+
|
161
|
+
expect(OCI8.properties[:tcp_keepalive_time]).to eq(3000)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
138
166
|
describe "with non-string parameters" do
|
139
167
|
before(:all) do
|
140
168
|
params = CONNECTION_PARAMS.dup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-oracle_enhanced-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.0.
|
4
|
+
version: 6.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raimonds Simanovskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0.0.
|
19
|
+
version: 6.0.0.rc2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.0.0.
|
26
|
+
version: 6.0.0.rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-plsql
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,33 +140,33 @@ signing_key:
|
|
140
140
|
specification_version: 4
|
141
141
|
summary: Oracle enhanced adapter for ActiveRecord
|
142
142
|
test_files:
|
143
|
-
- spec/active_record/oracle_enhanced/type/character_string_spec.rb
|
144
|
-
- spec/active_record/oracle_enhanced/type/text_spec.rb
|
145
|
-
- spec/active_record/oracle_enhanced/type/dirty_spec.rb
|
146
|
-
- spec/active_record/oracle_enhanced/type/integer_spec.rb
|
147
|
-
- spec/active_record/oracle_enhanced/type/national_character_string_spec.rb
|
148
|
-
- spec/active_record/oracle_enhanced/type/raw_spec.rb
|
149
|
-
- spec/active_record/oracle_enhanced/type/json_spec.rb
|
150
|
-
- spec/active_record/oracle_enhanced/type/float_spec.rb
|
151
|
-
- spec/active_record/oracle_enhanced/type/timestamp_spec.rb
|
152
|
-
- spec/active_record/oracle_enhanced/type/boolean_spec.rb
|
153
|
-
- spec/active_record/oracle_enhanced/type/binary_spec.rb
|
154
|
-
- spec/active_record/oracle_enhanced/type/decimal_spec.rb
|
155
|
-
- spec/active_record/oracle_enhanced/type/national_character_text_spec.rb
|
156
|
-
- spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb
|
157
143
|
- spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb
|
144
|
+
- spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb
|
145
|
+
- spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb
|
146
|
+
- spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb
|
147
|
+
- spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb
|
148
|
+
- spec/active_record/connection_adapters/oracle_enhanced/quoting_spec.rb
|
158
149
|
- spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb
|
159
150
|
- spec/active_record/connection_adapters/oracle_enhanced/dbms_output_spec.rb
|
160
151
|
- spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb
|
161
|
-
- spec/active_record/connection_adapters/oracle_enhanced/
|
152
|
+
- spec/active_record/connection_adapters/oracle_enhanced/context_index_spec.rb
|
162
153
|
- spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb
|
163
154
|
- spec/active_record/connection_adapters/oracle_enhanced/procedures_spec.rb
|
164
|
-
- spec/active_record/
|
165
|
-
- spec/active_record/
|
166
|
-
- spec/active_record/
|
167
|
-
- spec/active_record/
|
168
|
-
- spec/
|
155
|
+
- spec/active_record/oracle_enhanced/type/national_character_string_spec.rb
|
156
|
+
- spec/active_record/oracle_enhanced/type/dirty_spec.rb
|
157
|
+
- spec/active_record/oracle_enhanced/type/text_spec.rb
|
158
|
+
- spec/active_record/oracle_enhanced/type/timestamp_spec.rb
|
159
|
+
- spec/active_record/oracle_enhanced/type/binary_spec.rb
|
160
|
+
- spec/active_record/oracle_enhanced/type/float_spec.rb
|
161
|
+
- spec/active_record/oracle_enhanced/type/raw_spec.rb
|
162
|
+
- spec/active_record/oracle_enhanced/type/character_string_spec.rb
|
163
|
+
- spec/active_record/oracle_enhanced/type/json_spec.rb
|
164
|
+
- spec/active_record/oracle_enhanced/type/decimal_spec.rb
|
165
|
+
- spec/active_record/oracle_enhanced/type/national_character_text_spec.rb
|
166
|
+
- spec/active_record/oracle_enhanced/type/boolean_spec.rb
|
167
|
+
- spec/active_record/oracle_enhanced/type/integer_spec.rb
|
168
|
+
- spec/spec_config.yaml.template
|
169
169
|
- spec/support/alter_system_set_open_cursors.sql
|
170
|
+
- spec/support/alter_system_user_password.sql
|
170
171
|
- spec/support/create_oracle_enhanced_users.sql
|
171
172
|
- spec/spec_helper.rb
|
172
|
-
- spec/spec_config.yaml.template
|