We are using legacy database that goes down unexpectedly. This is bad experience for the user and for us.
When doing a simple query, like: User.find(1) and database goes down, it will not throw the exception. Just hangs there until database comes back.
Setting timeout did not seem to do any good either.
Running this:
connected = ActiveRecord::Base.connection_pool.with_connection { |con| con.active? } rescue false also hangs when connection is lost
Is there any way to check if the database is there before actuall making an ActiveRecord call?
Rails - 4.1.15
Ruby - jruby-9.0.5.0
Database: as400 (db2)