I too am interested in seeing this patch. I'm getting lots of idle
connections in postgres

On Mar 31, 5:26 am, J <juan...@gmail.com> wrote:
> Hello Michael,
>
> Would you share your temp patch here?
>
> TIA,
>
> J
>
> On Mar 20, 12:52 am, MikeL <michael.la...@gmail.com> wrote:
>
> > I wasn't sure where this stuff was being tracked, but I did find a
> > circular reference in the database wrapper. The DatabaseCreation and
> > DatabaseIntrospection objects being created in the MySQL wrapper where
> > passing references of itself, but there wasn't a per-defined method
> > for removing those references.
>
> > Should BaseDatabaseIntrospection and BaseDatabaseCreation be holding a
> > weakref of the database wrapper instead?
> > Or is there some connection pooling system that needs to be aware of
> > the Mulit-db stuff?
> > Does any of this seem sane?
>
> > My _hack_ (temp and not perfect I know) involved a class wrapping
> > around QuerySet and monitoring the clone counts (split per wrapper
> > instance) so when the final QuerySet was deleted it would clear the
> > two references allowing the database wrapper to be garbage collected.
>
> > TIA,
>
> > Michael LaRue
>
> > On Mar 19, 2:10 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
>
> > > On Thu, Mar 19, 2009 at 5:06 PM, MikeL <michael.la...@gmail.com> wrote:
>
> > > > I'm using the code from:
>
> > > >http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/
>
> > > > After repeated use, there can be over a hundred idling connection to
> > > > MySQL for both production and development builds. Removing the
> > > > Multiple DB in the model causes the symptoms to stop.
>
> > > > I've been trying to track down where the circular reference (if it's
> > > > that) is causing the connections to not be closed/deleted without much
> > > > luck. Is this use of _default_manager just plain flawed? If not, does
> > > > anyone know if there is a working fix?
>
> > > > TIA,
>
> > > > Michael LaRue
>
> > > It's not a default manager issue, the issue is by default django closes 
> > > the
> > > connection at the end of the request, but it only tracks the default
> > > connection, so your cusotm multidb support isn't tracked.
>
> > > Alex
>
> > > --
> > > "I disapprove of what you say, but I will defend to the death your right 
> > > to
> > > say it." --Voltaire
> > > "The people's good is the highest law."--Cicero
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to