On Jul 7, 2:23 pm, pachl <[email protected]> wrote:
> On Jul 5, 12:44 pm, Jeremy Evans <[email protected]> wrote:
>
> > I've just pushed a couple of patches that add additional disconnection
> > support.  Previously, disconnects were not detected when submitting
> > transaction statements such as BEGIN/ROLLBACK/COMMIT.  I've also added
> > disconnection support to more adapters.
>
> Does this mean Sequel will automatically try to re-connect?

For the adapters that detect disconnects, if a disconnection is
detected, a DatabaseDisconnectError exception is raised and the
connection is removed from the pool.  In general, if you only have a
single connection, that means a new connection will be created the
next time you execute a query.

> I run an app on my laptop that connects to a Postgres DB on the LAN.
> Whenever I put my laptop to sleep it looses the connection to the DB,
> thus the app must be restarted. I wonder if your update will fix this
> or is this a different issue?

It depends on how your app handles the disconnect error.  For most web
applications that don't have specific disconnection error handling, if
a disconnection is detected, the user will probably get an error page
if the disconnection is detected while loading that page.  However, if
they refresh, the next page load will usually result in a new
connection being made.

If you want to hide disconnection errors from users, you have to catch
the disconnect errors and retry.  Before retrying, you should be sure
what you are retrying is idempotent.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to