Skip to content
Merged
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 @@ -10,10 +10,14 @@
end

# check ruby-oci8 version
required_oci8_version = [2, 2, 0]
required_oci8_version = [2, 2, 4]
oci8_version_ints = OCI8::VERSION.scan(/\d+/).map { |s| s.to_i }
if (oci8_version_ints <=> required_oci8_version) < 0
raise LoadError, "ERROR: ruby-oci8 version #{OCI8::VERSION} is too old. Please install ruby-oci8 version #{required_oci8_version.join('.')} or later."
$stderr.puts <<-EOS.strip_heredoc
"ERROR: ruby-oci8 version #{OCI8::VERSION} is too old. Please install ruby-oci8 version #{required_oci8_version.join('.')} or later."
EOS

exit!
end

module ActiveRecord
Expand Down Expand Up @@ -325,6 +329,8 @@ def self.new_connection(config)
else
database
end
OCI8.properties[:tcp_keepalive] = true
OCI8.properties[:tcp_keepalive_time] = 600
conn = OCI8.new username, password, connection_string, privilege
conn.autocommit = true
conn.non_blocking = true if async
Expand Down