my problem is a pgbouncer which is dropping connections. Sysadmin set the client_idle_timeout to 60 seconds. Is there any solve on rails side for this? I mean, is there a possibility (a gem, or settings) to connect and drop connection (reconnection) to database every query we want to send ?
ruby 2.0.0
rails 4.2.3
pg 0.17.1
Im getting following error when connection is longer than x seconds (for example when I open rails console, wait x seconds and then run some ActiveRecord query to db):
ERROR: client_idle_timeout
Contract Load (0.5ms) SELECT "contracts".* FROM "contracts" ORDER BY "contracts"."id" ASC LIMIT 1
PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly :
SELECT "contracts".* FROM "contracts" ORDER BY "contracts"."id" ASC LIMIT 1
ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly :
SELECT "contracts".* FROM "contracts" ORDER BY "contracts"."id" ASC LIMIT 1