Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Holding Onto DB Connections
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Mettraux  
View profile  
 More options Sep 12 2008, 12:24 pm
From: "John Mettraux" <jmettr...@openwfe.org>
Date: Sat, 13 Sep 2008 01:24:26 +0900
Local: Fri, Sep 12 2008 12:24 pm
Subject: Re: [rufus] Re: Holding Onto DB Connections
On Sat, Sep 13, 2008 at 12:27 AM, Jim Mulholland

<jim.mulholl...@gmail.com> wrote:

> I added a "remove_connection" in my scheduler block which seems to
> have done the trick.

> Does anybody see an issue with this solution?

>    # Check every minute to see if any reminders need to be sent
>    scheduler.schedule_every('1m') do
>      ActivityReminder.send_reminders
>      ActiveRecord::Base.remove_connection
>    end

Hi Jim,

I guess you're using ActiveRecord 2.1.0. I've taken a look at
#remove_connection :

http://github.com/rails/rails/tree/v2.1.0/activerecord/lib/active_rec...

especially

http://github.com/rails/rails/tree/v2.1.0/activerecord/lib/active_rec...

Seems like it tries to have 1 connection per thread (it uses the
thread's object id to map the connection).

The rufus-scheduler triggers the jobs in their own threads, so as not
to block the whole scheduler. I think it matches your description of
the symptoms (too many open connections).

Thanks for finding this out, it's not a direct rufus-scheduler issue,
but I should document it anyway.

Best regards,

--
John Mettraux - http://jmettraux.wordpress.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google