I got this issue in JRuby / tomcat / rails before using JNDI.
Basically the issue was prior to rails 2.2 there was no connection
pool so if the timeout value in mysql hit a stale connection I got
this.  So we implemented DBCP connection pooling in tomcat which
forced a test on the connection before using it.

Now with rails and connection pooling its probably worth looking to
see if the new code supports something like this.

I will say that the "gone away..." errors are gone but i still see a
lot of "broken pipe" errors which I am trying to resolve.

Adam

On Mon, Jan 26, 2009 at 12:53 PM, Fritz Anderson
<rails-mailing-l...@andreas-s.net> wrote:
>
> Fritz Anderson wrote:
>> I'm still working on recovering from a Mysql::Error (MySQL server has
>> gone away: SELECT...). I constructed a function to wrap around Active
>> Record finds, which would rescue Mysql::Error, log the event, and
>> attempt to reconnect after a pause.
>>
>> The rescue does not trap the exception. Can anyone help me figure out
>> why? The code sample below shows what's on the call stack.
>
> Further question: The full exception message (less the stack trace) is
>
> ==
> /usr/lib64/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in
> `log': Mysql::Error: MySQL server has gone away: SELECT * FROM
> `messages` WHERE (`messages`.`disposition` IS NULL)  ORDER BY senttime
> (ActiveRecord::StatementInvalid)
> ==
>
> Note the "ActiveRecord::StatementInvalid." Is that the exception I
> should have been rescuing?
>
>    — F
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to