And if i don't invoke this thread, whole app works fine. So MYSQL
connection is intact in main thread, but on spawned thread hits the
block with:
Mysql::Error: Lost connection to MySQL server during query: BEGINe[0m
And if i don't invoke this thread, whole app works fine. So MYSQL
connection is intact in main thread, but on spawned thread hits the
block with:
Mysql::Error: Lost connection to MySQL server during query: BEGIN [0m
Have you set ActiveRecord::Base.allow_concurency to true ?
AFAIK this is a problem with the mysql connector supplied with Rails. Install mysql gem and then use it in the thread to connect to mysql. MySQL new connections are very light weight and hence there should be no problem with opening extra connection(I may be wrong here)
And if i don't invoke this thread, whole app works fine. So MYSQL
connection is intact in main thread, but on spawned thread hits the
block with:
Mysql::Error: Lost connection to MySQL server during query: BEGIN [0m
Have you set ActiveRecord::Base.allow_concurency to true ?
Fred
If I set this in environment.rb, app fails totally Below is the
error.
#<NoMethodError: undefined method `requires_reloading?' for {}:Hash>
I tried doing , ActiveRecord::Base.establish_connection with in thread.
Though it doesn't fail when i do so, i dont see any actions being
performed on database though.
I am totally lost! How do I set this allow_concurrency? My develoment
machine is windows and I am using webrick.
AFAIK this is a problem with the mysql connector supplied with Rails.
Install mysql gem and then use it in the thread to connect to mysql.
MySQL
new connections are very light weight and hence there should be no
problem
with opening extra connection(I may be wrong here)
On Thu, Mar 27, 2008 at 12:41 AM, Frederick Cheung <
Hi Piyush,
I installed mysql-gem (win32) . Do I need to do some intialization in
the thread before accessing the database?