Eugene Lazutkin wrote:

>If I understood you correctly, you proposes to introduce new
>USING_THREAD_POOL setting. If it is set, we don't close connection
>hoping that it is going to be reused, if the thread itself was reused
>for other request. It leaves the connection open until thread dies and
>is garbage-collected, or closed by database implicitly.
>  
>
It's not at all that simple in practice. You can't just leave the
connection for later reuse because it holds the whole environment:
transactions, locale settings, authentication, may be something else.
Each bit of this environment should be handled separately:

- transactions should be rollbacked
- locale can't be undone and thus should be set to new one on each
cursor, not only on each opening connection
- authentication is even more complex: you can't logout user from a
database (AFAIK) so you can track connection users and don't let this
connection to be reused by another user

And after this you can some application dependent settings that
application expects to vanish after it closes the connection, they can't
be reset automatically at all :-). Such unforunate applications should
do those specific things manually before closing connections.

I beleive that connection pooling should be left to other existing
projects (like http://sqlrelay.sourceforge.net/)

--~--~---------~--~----~------------~-------~--~----~
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