activerecord-oracle_enhanced-adapter 5.2.5 → 5.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96c7fa4de066e2d4d2492b064971617ba8e620ca29ed9e96a7f047dd83891f70
4
- data.tar.gz: bfc5981760050745f599322e94818052973a51e8348a3419b8ed588862472545
3
+ metadata.gz: 7d5b394e21a47693fd91ae861de7fbe948c2ccf8adff47aa75e66f04a712e19a
4
+ data.tar.gz: 94709d26f51820edf61471555b745a5a0b0ca17e6be87279bfc163a87c8ec911
5
5
  SHA512:
6
- metadata.gz: 4a25dbb40fd9e61d160013dce15a4854401aa5ef2d93afe3175fe9b448e2ed1710c26566693fd0a14c5ad9603fa61077501bc873348cd6e32b990c60aa3877aa
7
- data.tar.gz: 2b423eac2b473ea34a32e641936baa308be3e3daa81f8fe5f6a3e21ea7a83bdb8c79306c72a531d5d197e5e244a81b75f5b2831ba6c72be1c3de6f563a798233
6
+ metadata.gz: 423800f0ebcc07628eea06e1af00544aac8302c6ca0709ef93b4a52827a0ee5c67a50208f5d16a2eb1b763a5a7d690f4ba1df7902f1c9e2eb276d06387dc6e42
7
+ data.tar.gz: fd6986f2103ce6559a3ff7e212b312030b8740c5e01569988631f489f196d7e3f1e6341e9e07eea56040d4a17b9f6036bf78a2744cdc1126f7a1a7ae4c3ce863
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 5.2.5 / 2019-05-17
2
+
3
+ * Changes and bug fixes
4
+ * Add TCP keepalive and TCP keepalive time configurations [#1874 #1878]
5
+ * CI against Ruby 2.6.2 and 2.5.5 #1849
6
+ * CI against Ruby 2.4.6 #1858
7
+
1
8
  ## 5.2.5 / 2019-03-05
2
9
 
3
10
  * Changes and bug fixes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.2.5
1
+ 5.2.6
@@ -285,6 +285,8 @@ module ActiveRecord
285
285
  # The OracleEnhancedOCIFactory factors out the code necessary to connect and
286
286
  # configure an Oracle/OCI connection.
287
287
  class OracleEnhancedOCIFactory #:nodoc:
288
+ DEFAULT_TCP_KEEPALIVE_TIME = 600
289
+
288
290
  def self.new_connection(config)
289
291
  # to_s needed if username, password or database is specified as number in database.yml file
290
292
  username = config[:username] && config[:username].to_s
@@ -314,11 +316,13 @@ module ActiveRecord
314
316
  else
315
317
  database
316
318
  end
317
- OCI8.properties[:tcp_keepalive] = true
319
+
320
+ OCI8.properties[:tcp_keepalive] = config[:tcp_keepalive] == false ? false : true
318
321
  begin
319
- OCI8.properties[:tcp_keepalive_time] = 600
322
+ OCI8.properties[:tcp_keepalive_time] = config[:tcp_keepalive_time] || DEFAULT_TCP_KEEPALIVE_TIME
320
323
  rescue NotImplementedError
321
324
  end
325
+
322
326
  conn = OCI8.new username, password, connection_string, privilege
323
327
  conn.autocommit = true
324
328
  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
  #
@@ -122,6 +122,34 @@ describe "OracleEnhancedConnection" do
122
122
  end
123
123
  end
124
124
 
125
+ if defined?(OCI8)
126
+ describe "with TCP keepalive parameters" do
127
+ it "should use database default `tcp_keepalive` value true by default" do
128
+ ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS)
129
+
130
+ expect(OCI8.properties[:tcp_keepalive]).to be true
131
+ end
132
+
133
+ it "should use modified `tcp_keepalive` value false" do
134
+ ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS.dup.merge(tcp_keepalive: false))
135
+
136
+ expect(OCI8.properties[:tcp_keepalive]).to be false
137
+ end
138
+
139
+ it "should use database default `tcp_keepalive_time` value 600 by default" do
140
+ ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS)
141
+
142
+ expect(OCI8.properties[:tcp_keepalive_time]).to eq(600)
143
+ end
144
+
145
+ it "should use modified `tcp_keepalive_time` value 3000" do
146
+ ActiveRecord::ConnectionAdapters::OracleEnhanced::Connection.create(CONNECTION_PARAMS.dup.merge(tcp_keepalive_time: 3000))
147
+
148
+ expect(OCI8.properties[:tcp_keepalive_time]).to eq(3000)
149
+ end
150
+ end
151
+ end
152
+
125
153
  describe "with non-string parameters" do
126
154
  before(:all) do
127
155
  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: 5.2.5
4
+ version: 5.2.6
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-03-05 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord