Thank you, I've read the docs about this extension and thought it might be reasonable to suggest an improvement to it. From the docs:
As checking connections for validity involves issuing a query, which is > potentially an expensive operation, the validation checks are only run if > the connection has been idle for longer than a certain threshold Wouldn't it then make sense have a single point of entry - a method through which all DB requests are issued - in which we catch the said exception and then reconnect if needed? This would spare us the unnecessary DB request in the case when connection is valid. No? четверг, 16 апреля 2015 г., 5:41:53 UTC+7 пользователь Jeremy Evans написал: > > On Wednesday, April 15, 2015 at 3:37:24 PM UTC-7, Roman Snitko wrote: >> >> I'm using Sequel in a Rails app along with ActiveRecord. Sequel manages a >> connection to a separate pg database. Note: I am *NOT using* >> *sequel-rails* because it doesn't support working along with >> ActiveRecord. >> >> So, I sometimes see the following error: >> PG::ConnectionBad: PQconsumeInput() SSL error: sslv3 alert bad record mac >> which disappears on page refresh. >> >> I presume what happens is, it spews that error, then reconnects. But user >> is inconvenienced with 500 page screen. Can you advise me what's the best >> course of action here to ensure continuous connectivity? >> > > You presume correctly. You can use the connection_validator extension to > check connection validity before use: > http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/connection_validator_rb.html > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
