Forum: Ruby on Rails Forking in Rails => Boom. Mysql has gone away.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F834639f44ffe5f03e816a3f33b83aae?d=identicon&s=25 Daniel Guermeur (Guest)
on 2006-01-14 01:35
(Received via mailing list)
Hello,

We are running Rails on www.montastic.com (free website monitoring
service w/ ajax and RSS feeds) and we are trying to fork a process
within a model e.g. and continue the query the  model stored data e.g.

in model server.rb...

Server.count
==> 1111

fork {
 Server.count
}

==> Boom. Mysql has gone away...

Is there a way to fork in a way to keep the database connection?
--
supercobra@gmail.com
6c27f78ab0eee78732ae54e8b8718b84?d=identicon&s=25 David Felstead (Guest)
on 2006-01-14 02:17
(Received via mailing list)
You'll need to establish a new connection in the forked process - that
will keep them separate.

Cheers,

-DF
This topic is locked and can not be replied to.