On 11/28/06, Eric Floehr <[EMAIL PROTECTED]> wrote:
> Does this mean that connection.queries isn't "global"?  When do
> connections get created and destroyed?  How can I dump an array of ALL
> queries and query times since the server started?

The value of 'connection.queries' will persist only as long as the
database connection it's associated with, and Django closes the
connection at the end of each request/response cycle.

Your best bet for keeping a running log of all queries in all requests
over time is to write a middleware class with 'process_response'
method which grabs 'connection.queries' and logs the list of queries
to a file (this will work because response middleware is applied
before the database connection is closed).


-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

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

Reply via email to