On Oct 19, 9:22 am, raymond ramone <[email protected]> wrote:
>> Hi guys,
>>
>>    I am using a simple daemon gem and now whenever I use it with
>> sequel it always
>> gives me the error "MySQL server has gone away"  Any idea why and what
>> could be the
>> solution?

On Tue, Oct 19, 2010 at 10:28 AM, Jeremy Evans <[email protected]> replied:
> Just a guess that the daemon gem forks and you are connecting before
> the fork.  That's not kosher with Sequel, you have to disconnect
> (DB.disconnect) before forking.  Otherwise, when one process exits,
> it'll disconnect the database connection socket used, and the other
> process will give you an error like the one you received the next time
> you try to run a query.
>
> Jeremy

Or the daemon is long-running and the MySQL session has timed out
since the last use, or perhaps the system or an intervening network
stateful firewall has expired the TCP connection.

The long-running or not-used-very-often-web-app issue causing timeouts
hit me.  Rather than increase MySQL's timeout length to days--which
work-around doesn't work if the problem is a firewall or other
network-related-issue--I opted to wrap the app in an exception handler
that used retry to attempt the operation again.  That worked best for
my particular app.

Aaron out.

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