Firewall closes database connections resulting in hung mongrel processes

There are actually two separate issues I am experiencing:

  • A firewall between our app and database closes the connection behind
    us after 30 mins
  • After a period of inactivity oracle closes connections on us

Both of these issues prevent mongrel to respond because rails doesn’t
realize the connections have been terminated. Anyone experience
something similar in the past to offer some ideas.

We’ve tried the verification_timeout setting but it doesn’t apply here
to Oracle (like MySql). We tried setting the auto_retry property on
the OCI8AutoRecover Class with no results. We have even attempted to
override some default behaviour of AR so that we verify, timeout or
disconnect connections before executing a query but still have not had
successful results.