> On Sun, May 19, 2013 at 12:25 PM, James Le Cuirot
> <
ch...@aura-online.co.uk>wrote:
>
> > On Sun, 19 May 2013 09:31:19 +0200
> > Andrius Kairiukstis <
and...@kairiukstis.com> wrote:
> >
> > > And concurrency is only one major AR issue, hope someday it will
> > > be fixed by developers. Access lockers helps with that.
> >
> > Opinions differ on this but I believe it is already resolved in the
> > upcoming Rails 4. There was an issue where you had to allocate an
> > unreasonably large pool size to avoid long delays and timeouts while
> > waiting for a connection. This was because the queue was not fair
> > but essentially random. I have backported this fix to 3.2.13 if
> > you're interested.
> >
> > You still have to wrap all database activity in
> > ActiveRecord::Base.connection_pool.with_connection blocks though.
> > I'm not sure what Sequel does but I don't find this unreasonable.
> > Without this, the connection either has to remain open for the
> > duration of the thread (which could be very long) or some arbitrary
> > timeout must be used. I'd rather say exactly when my database
> > connections are needed.
> >
> > Regards,
> > James
> >
Please see the attached patch. The original work comes from:
I just brought it up to date. It wasn't merged for Rails 3 because it
investigate. I do use PostgreSQL so I haven't used this patch in