On Mon, Sep 03, 2007 at 04:11:34PM +0200, Benjamin Krause wrote:
> 
> On 2007-09-03, at 3:52 PM, Matthew Langham wrote:
> 
> > I need to add that we are running the integrated aaf Ferret Drb  
> > Server,
> > so I guess it is the Drb Server that is losing the connection? How  
> > can I
> > get it to reconnect without throwing the error?
> 
> Hey ..
> 
> we've got the same error with our non-aaf backgroundrb solution ..
> 
> that's what we're doing:
> 
> begin
>    index_object( record )
> rescue ActiveRecord::RecordNotFound
>    @logger.warn "Object gone"
> rescue ActiveRecord::StatementInvalid
>    @logger.warn "MySQL is gone.."
>    clazz.connection.reconnect!
>    enqueue_object( record )
> end
> 
> So basically just catch the StatementInvalid Exception and
> try again after you reconnected to the database..
> 
> I guess Jens can add something like that to AAF quite easily :)

Okay, I just committed this. According to my limited testing it works as
intended - close db connection with Model.connection.disconnect, and it
will reconnect again.

Please give it a try and report the outcome here :-)

cheers,
Jens

-- 
Jens Krämer
http://www.jkraemer.net/ - Blog
http://www.omdb.org/     - The new free film database
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to