Another issue to watch out for with automatic mysql reconnection is that the
new connection will not have any of the settings that sequel applies when it
first connects. This includes, for instance, the wait_timeout value and the
connection charset setting. I ran into this back when when sequel allowed
libmysqlclient to reconnect; the charset on the connection would revert back
to latin1 from utf8 after reconnection, causing many encoding headaches
when retrieving data later.

  Aman

On Thu, Jan 6, 2011 at 7:20 PM, Jeremy Evans <[email protected]> wrote:

> On Jan 6, 9:13 am, Jeremy Evans <[email protected]> wrote:
> > > > Another reason is that implicit reconnection can cause the same
> > > > statement to be executed twice, leading to problems with non-
> > > > idempotent statements.
> >
> > > I didn't know that - do you know if that is that a general mysql issue
> > > or just an issue with Sequel? (wondering whether I should be removing
> > > the reconnect: true option from my various ActiveRecord-related
> > > projects)
> >
> > AFAIK, it's a general issue with how implicit reconnection has to
> > work.  The fact that it's turned off by default should mean something.
>
> I forgot to mention earlier that implicitly reconnection probably
> doesn't deal well with transactions for obvious reasons.  Basically, a
> database connection has state, and implicitly reconnecting creates a
> new connection with different state, but there's no way for Sequel (or
> other database libraries) to know that the state was changed.
>
> 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]<sequel-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/sequel-talk?hl=en.
>
>

-- 
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