On Sun, 2009-04-12 at 06:39 -0700, Continuation wrote:
> I can't find any info on that in the doc.
> 
> Does that mean DB connections are not reused? If so, why? Seeing how
> establishing DB connection is a pretty expensive operation I'd think
> it makes sense to reuse them.

One connection per request and then it's closed.
> 
> Any way to have persistent connection with Django?

Managing database connections in any advanced manner is quite complex
and definitely out of scope for Django, because there are better tools.
Django is a "shared nothing" (well, as close as possible) architecture,
which means there is no requirement or dependency on anything have a
lifecycle beyond a single request/response.

If you want persistent connections, there are appropriate
database-specific tools for making that happen transparently. For
example, pgpool2 for PostgreSQL -- Django opens a connection to it (it
behaves like a database server from an API perspective) and it manages
the connections to the remote server.

Regards,
Malcolm



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