Ian Harding wrote:
... works fine, but you have to do it "The Rails Way" and expect no help from the "Community" because they are a fanboi cheerleader squad, not interested in silly stuff like referential integrity, functions, triggers, etc. All that nonsense belongs in the application!
You exaggerate. There's nothing that says you need to only use ActiveRecord's out-of-the-box configuration with rails apps. All of our models directly use their postgresql library which is just a wrapper around libpq; and from there you can use whatever postgresql specific tricks you'd like (postgis types was the main reason we used that instead of ActiveRecord).
Check this out, there is no stale connection detection or handling in rails. I'm not kidding. If you connection drops out, restart your web server. Sorry. Blah.
Which is a reasonable default. If you want to catch the exception and re-set the connection, you surely can do so. We prefer to catch the exception and make the machine take itself out of the load-balancing pool so we can diagnose the problem rather than trying to automatically do (whatever it is you expected it to do). We're drifting way off topic so I'll stop here. I'd be happy to discuss further via email or on the rails lists.