Dan Watson wrote:

> Ideally, it seems django should offer simple connection pooling with 2
> options: number of connections and an on/off switch. That would satisfy
> the needs of some/most, and for those that need something more robust,
> look into an external pooler.

Thinking this over a bit more, I think the best solution may be to just
provide a hook in core that pool-wanters can use to install pooled
connection management.

Conveniently :), in the multi-db branch, connections are managed
through a connection manager, so there's the hook for those who want to
use pooling. The default manager creates one connection per thread, but
making one that uses a robust pooling mechanism would be as simple as:

1. stealing sqlalchemy's pool code (MIT licensed)
2. plugging it into a class that acts like
django.db.LazyConnectionManager but checks out connections from a pool;
the tough part will be hooking up connection.close() to release the
connection back into the pool
3. from django import db; db.connections = YourPoolingClass()

So in multi-db at least it's doable without too much hackery, and you
can plug in whatever kind of pooling you need.

JP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to