Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 'database does not exist' error #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix for 'database does not exist' error #7

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 15, 2012

If you are using a MySQL database, your app will throw you a 'database does not exist' error after you leave it idle for a few hours. Apparently, MySQL times-out the database connection if it doesn't receive a command for a while (mine turned out to be 8 hours).

Rails doesn't have this problem because it auto-verifies the database connection before it runs the controllers, and re-connects if it needs to. I'm adding this exact same behaviour to the library.

TLDR: You need to call 'ActiveRecord::Base.verify_active_connections!'

@janko
Copy link

janko commented May 22, 2012

You can download the new version of the gem, I've submitted your commit. I'm the new maintainer now, here's my fork :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants