Rails app using two different databases

8 views
Skip to first unread message

Paulo Henrique Castro

unread,
Jan 19, 2012, 1:57:33 PM1/19/12
to Phusion Passenger Discussions
Hi guys,

I just post this issue a few seconds ago, but I was thinking if
someone else got the same problem and have some ideas to workaround
it.

Thanks in advance for any help!

What steps will reproduce the problem?
1. Create a model on Rails and a simple CRUD views
2. Create 2 different databases to store the same model records (i.e.:
Sqlite and Mysql)
3. Start your app
4. Determine dynamically during runtime, to use the Sqlite database
and execute some CRUD instructions
5. With your app still running, change dynamically your app to use the
Mysql database
6. You will eventually get messages like: "Mysql::Error: You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use(...)"

What is the expected output? What do you see instead?
The app should not cache the SQL queries to database, this way I
wouldn't get error messages

What version of Phusion Passenger are you using? Which version of
Rails? On
what operating system?
Phusion Passenger version 3.0.11, Rails 2.3.11, Linux Ubuntu 11.10

Please provide any additional information below.

I have some clients using my rails app with Sqlite database, and
others using this same app but with Mysql. When the app starts and the
first user is a Sqlite database client, the Mysql clients will start
to get error messages since Passenger is caching the SQL queries.
Reply all
Reply to author
Forward
0 new messages