Ivan Sagalaev wrote:
> 
> 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

I assume that by the time close() is called the transactions are taken 
care of.

> - locale can't be undone and thus should be set to new one on each
> cursor, not only on each opening connection

Django uses one locale at the moment, right?

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

The same goes for db user --- one user is reused across all connections.

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

Clearly we cannot foresee application-specific requirements. I assume 
some hooks can be used for that.

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

In ideal world --- yes. ;-)

 > Cheap pooling (by just not closing connections) wouldn't let you control
 > separately lifetime and quantity of Apache child processes and open db
 > connections. And this is usually needed since these are completely
 > different things in terms of server load.

This is the true problem, which hampers any solution, which is not web 
server specific.

I guess it is better to leave it for possible future enhancements.

Thanks,

Eugene


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