From ab585f5ae2d1d016a5f99d0e9a542f6f41c4df53 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Sun, 18 Jun 2017 21:14:03 +0000 Subject: [PATCH] Some platforms do not support `OCI8.properties[:tcp_keepalive_time]` Refer "Hanging After a Long Period of Inactivity" http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/hanging-after-inactivity.md --- .../connection_adapters/oracle_enhanced/oci_connection.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb b/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb index 85031fb45..e16e2dc95 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb @@ -330,7 +330,10 @@ def self.new_connection(config) database end OCI8.properties[:tcp_keepalive] = true - OCI8.properties[:tcp_keepalive_time] = 600 + begin + OCI8.properties[:tcp_keepalive_time] = 600 + rescue NotImplementedError + end conn = OCI8.new username, password, connection_string, privilege conn.autocommit = true conn.non_blocking = true if async