Hi people, I am running some Django code that creates objects in the database. I am using PostgreSQL via psycopg2. However, I am running this code from the Django shell, and not as part of a request. I therefore have to handle a few things manually, for example, closing connections to the database. The code creates multiple threads to do the object creation, and I soon hit the maximum limit of allowed connections to the database.
How can I get hold of the connection used to create the object, from within each thread, so that each thread closes the connection that it has just used? Alternatively, how can I get a list of all the open connections that Django is using at any one time. I am using the "standard" model query API, and not executing custom SQL directly. Thanks, Joseph. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.