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

Set up an after hook to clear active connections after each request #10

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

Conversation

nbudin
Copy link

@nbudin nbudin commented Apr 18, 2012

Recent versions of ActiveRecord don't automatically release connections back into the pool. Without this patch, the user has to manually set up this hook if they don't want every nth request to hang for 5 seconds (where n is the number of connections in the pool).

@mcfiredrill
Copy link

I'm using this too, found out about it via this thread:

https://groups.google.com/forum/#!msg/copenhagen-ruby-user-group/GEHgi_WudmM/gnCiwWqmVfMJ

@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 :)

@mcfiredrill
Copy link

👍

@nbudin
Copy link
Author

nbudin commented May 27, 2012

Great, thanks janko-m! Glad to meet the new maintainer in town, and it looks like you're already doing great work with your fork.

@janko
Copy link

janko commented May 27, 2012

My pleasure :)

mediaslave24 referenced this pull request in mediaslave24/sinatra-activerecord Jul 18, 2013
@cefigueiredo
Copy link

Some news about that PR? I'm gettin struck by this problem too... sinatra-activerecord are not releasing a connection, and creating some until the pool cap, getting exceptions on every request after!

@janko
Copy link

janko commented Sep 1, 2014

Well, the PR is merged, so if you're still having problems, post an issue to janko-m/sinatra-activerecord.

@lksv
Copy link

lksv commented Aug 25, 2015

why don't use middleware: use ActiveRecord::ConnectionAdapters::ConnectionManagement?

janko added a commit to sinatra-activerecord/sinatra-activerecord that referenced this pull request Aug 25, 2015
@janko
Copy link

janko commented Aug 25, 2015

@lksv Thanks, I didn't know that existed. It's certainly a more robust way, so I updated the gem and released a new version.

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.

None yet

5 participants