activerecord-oracle_enhanced-adapter 1.6.6 → 1.6.7
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 +4 -4
- data/History.md +8 -0
- data/README.md +71 -1
- data/VERSION +1 -1
- data/activerecord-oracle_enhanced-adapter.gemspec +2 -2
- data/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb +2 -2
- data/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb +1 -1
- data/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09cf6c7e3e814929e2d9b16c8a917832db065b51
|
4
|
+
data.tar.gz: 327245153b57e09f6eb11d43edfc32c9a6cc31f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca8b383f94e657873ef9d6d2dbb54fbe8897fb4d10b7a1efc5d9f2f1cef588a705d5ae18aaa5062704ad548e09bb4d646139a76ebb38628808e06676fa58b4c9
|
7
|
+
data.tar.gz: 22a8535d6a83bc61da0cdc7a0e441a7cdb486ab2012305fd849dbddeed407fa409e2dc1db25e5a3441bc558f2ee49ed8f748ff39b98899444ce5b8d1b45760e6
|
data/History.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 1.6.7 / 2016-03-08
|
2
|
+
|
3
|
+
* Changes and bug fixes since 1.6.6
|
4
|
+
* Support Rails 4.2.6
|
5
|
+
* Support t.foreign_key use the same `to_table` twice [#783]
|
6
|
+
* Remove "warning: (...) interpreted as grouped expression" [#765]
|
7
|
+
* Add documentation on setting read, write and connect timeouts [#761]
|
8
|
+
|
1
9
|
## 1.6.6 / 2016-01-21
|
2
10
|
|
3
11
|
* Changes and bug fixes since 1.6.5
|
data/README.md
CHANGED
@@ -173,7 +173,10 @@ or you can even use Oracle specific TNS connection description:
|
|
173
173
|
```yml
|
174
174
|
development:
|
175
175
|
adapter: oracle_enhanced
|
176
|
-
database: "(DESCRIPTION=
|
176
|
+
database: "(DESCRIPTION=
|
177
|
+
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
|
178
|
+
(CONNECT_DATA=(SERVICE_NAME=xe))
|
179
|
+
)"
|
177
180
|
username: user
|
178
181
|
password: secret
|
179
182
|
```
|
@@ -506,6 +509,65 @@ development:
|
|
506
509
|
schema: tableowner
|
507
510
|
```
|
508
511
|
|
512
|
+
### Timeouts
|
513
|
+
|
514
|
+
By default, OCI libraries set a connect timeout of 60 seconds (as of v12.0), and do not set a data receive timeout.
|
515
|
+
|
516
|
+
While this may desirable if you process queries that take several minutes to complete, it may also lead to resource exhaustion if
|
517
|
+
connections are teared down improperly during a query, e.g. by misbehaving networking equipment that does not inform both peers of
|
518
|
+
connection reset. In this scenario, the OCI libraries will wait indefinitely for data to arrive, thus blocking indefinitely the application
|
519
|
+
that initiated the query.
|
520
|
+
|
521
|
+
You can set a connect timeout, in seconds, using the following TNSNAMES parameters:
|
522
|
+
|
523
|
+
* `CONNECT_TIMEOUT`
|
524
|
+
* `TCP_CONNECT_TIMEOUT`
|
525
|
+
|
526
|
+
Example setting a 5 seconds connect timeout:
|
527
|
+
|
528
|
+
```yml
|
529
|
+
development:
|
530
|
+
database: "(DESCRIPTION=
|
531
|
+
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
|
532
|
+
(CONNECT_TIMEOUT=5)(TCP_CONNECT_TIMEOUT=5)
|
533
|
+
(CONNECT_DATA=(SERVICE_NAME=xe))
|
534
|
+
)"
|
535
|
+
```
|
536
|
+
You should set a timeout value dependant on your network topology, and the time needed to establish a TCP connection with your ORACLE
|
537
|
+
server. In real-world scenarios, a value larger than 5 should be avoided.
|
538
|
+
|
539
|
+
You can set receive and send timeouts, in seconds, using the following TNSNAMES parameters:
|
540
|
+
|
541
|
+
* `RECV_TIMEOUT` - the maximum time the OCI libraries should wait for data to arrive on the TCP socket. Internally, it is implemented
|
542
|
+
through a `setsockopt(s, SOL_SOCKET, SO_RCVTIMEO)`. You should set this value to an integer larger than the server-side execution time
|
543
|
+
of your longest-running query.
|
544
|
+
* `SEND_TIMEOUT` the maximum time the OCI libraries should wait for write operations to complete on the TCP socket. Internally, it is
|
545
|
+
implemented through a `setsockopt(s, SOL_SOCKET, SO_SNDTIMEO)`. Values larger than 5 are a sign of poorly performing network, and as
|
546
|
+
such it should be avoided.
|
547
|
+
|
548
|
+
Example setting a 60 seconds receive timeout and 5 seconds send timeout:
|
549
|
+
|
550
|
+
```yml
|
551
|
+
development:
|
552
|
+
database: "(DESCRIPTION=
|
553
|
+
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
|
554
|
+
(RECV_TIMEOUT=60)(SEND_TIMEOUT=5)
|
555
|
+
(CONNECT_DATA=(SERVICE_NAME=xe))
|
556
|
+
)"
|
557
|
+
```
|
558
|
+
|
559
|
+
Example setting the above send/recv timeout plus a 5 seconds connect timeout:
|
560
|
+
|
561
|
+
```yml
|
562
|
+
development:
|
563
|
+
database: "(DESCRIPTION=
|
564
|
+
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
|
565
|
+
(CONNECT_TIMEOUT=5)(TCP_CONNECT_TIMEOUT=5)
|
566
|
+
(RECV_TIMEOUT=60)(SEND_TIMEOUT=5)
|
567
|
+
(CONNECT_DATA=(SERVICE_NAME=xe))
|
568
|
+
)"
|
569
|
+
```
|
570
|
+
|
509
571
|
TROUBLESHOOTING
|
510
572
|
---------------
|
511
573
|
|
@@ -552,6 +614,14 @@ When Apache with Phusion Passenger (mod_passenger or previously mod_rails) is us
|
|
552
614
|
* Create wrapper script as described in [Phusion blog](http://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ruby-from-phusion-passenger) or [RayApps::Blog](http://blog.rayapps.com/2008/05/21/using-mod_rails-with-rails-applications-on-oracle)
|
553
615
|
* Set environment variables in the file which is used by Apache before launching Apache worker processes - on Linux it typically is envvars file (look in apachectl or apache2ctl script where it is looking for envvars file) or /System/Library/LaunchDaemons/org.apache.httpd.plist on Mac OS X. See the following [discussion thread](http://groups.google.com/group/oracle-enhanced/browse_thread/thread/c5f64106569fadd0) for more hints.
|
554
616
|
|
617
|
+
### What to do if my application is stuck?
|
618
|
+
|
619
|
+
If you see established TCP connections that do not exchange data, and you are unable to terminate your application using a TERM or an INT
|
620
|
+
signal, and you are forced to use the KILL signal, then the OCI libraries may be waiting indefinitely for a network read operation to
|
621
|
+
complete.
|
622
|
+
|
623
|
+
See the **Timeouts** section above.
|
624
|
+
|
555
625
|
RUNNING TESTS
|
556
626
|
-------------
|
557
627
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.7
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{activerecord-oracle_enhanced-adapter}
|
8
|
-
s.version = "1.6.
|
8
|
+
s.version = "1.6.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.license = 'MIT'
|
12
12
|
s.authors = [%q{Raimonds Simanovskis}]
|
13
|
-
s.date = %q{
|
13
|
+
s.date = %q{2016-03-08}
|
14
14
|
s.description = %q{Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
|
15
15
|
This adapter is superset of original ActiveRecord Oracle adapter.
|
16
16
|
}
|
@@ -123,7 +123,7 @@ module ActiveRecord
|
|
123
123
|
if without_prepared_statement?(binds)
|
124
124
|
cursor = @connection.prepare(sql)
|
125
125
|
else
|
126
|
-
unless @statements.key?
|
126
|
+
unless @statements.key?(sql)
|
127
127
|
@statements[sql] = @connection.prepare(sql)
|
128
128
|
end
|
129
129
|
|
@@ -229,7 +229,7 @@ module ActiveRecord
|
|
229
229
|
# Returns default sequence name for table.
|
230
230
|
# Will take all or first 26 characters of table name and append _seq suffix
|
231
231
|
def default_sequence_name(table_name, primary_key = nil)
|
232
|
-
table_name.to_s.gsub
|
232
|
+
table_name.to_s.gsub((/(^|\.)([\w$-]{1,#{sequence_name_length-4}})([\w$-]*)$/), '\1\2_seq')
|
233
233
|
end
|
234
234
|
|
235
235
|
# Inserts the given fixture into the table. Overridden to properly handle lobs.
|
@@ -89,7 +89,7 @@ module ActiveRecord
|
|
89
89
|
end
|
90
90
|
td.indexes.each_pair { |c,o| add_index table_name, c, o }
|
91
91
|
|
92
|
-
td.foreign_keys.
|
92
|
+
td.foreign_keys.each do |other_table_name, foreign_key_options|
|
93
93
|
add_foreign_key(table_name, other_table_name, foreign_key_options)
|
94
94
|
end
|
95
95
|
end
|
@@ -808,8 +808,8 @@ module ActiveRecord
|
|
808
808
|
select NVL(max(#{quote_column_name(primary_key)}),0) + 1 from #{quote_table_name(table_name)}
|
809
809
|
", new_start_value)
|
810
810
|
|
811
|
-
execute
|
812
|
-
execute
|
811
|
+
execute "DROP SEQUENCE #{quote_table_name(sequence_name)}"
|
812
|
+
execute "CREATE SEQUENCE #{quote_table_name(sequence_name)} START WITH #{new_start_value}"
|
813
813
|
end
|
814
814
|
end
|
815
815
|
|
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: 1.6.
|
4
|
+
version: 1.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raimonds Simanovskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jeweler
|