Hi all,
I'm using Django's ORM within a non-web application. This application
creates several processes using the module multiprocessing. Each
process performs several queries to a unique Postgres database.
When the processes run altogether I get:
...
File
"/usr/lib/python2.5/site-packages/Django-1.1-py2.5.egg/django/db/models/query.py",
line 81, in __len__
self._result_cache = list(self.iterator())
File
"/usr/lib/python2.5/site-packages/Django-1.1-py2.5.egg/django/db/models/query.py",
line 238, in iterator
for row in self.query.results_iter():
File
"/usr/lib/python2.5/site-packages/Django-1.1-py2.5.egg/django/db/models/sql/query.py",
line 287, in results_iter
for rows in self.execute_sql(MULTI):
File
"/usr/lib/python2.5/site-packages/Django-1.1-py2.5.egg/django/db/models/sql/query.py",
line 2369, in execute_sql
cursor.execute(sql, params)
InternalError: SET TRANSACTION ISOLATION LEVEL must be called before any query
As far as I understand, the problem is that the parent process opens a
unique connection to the database, and all its children use that same
connection.
How can I solve this issue? How can I force that each query opens and
*closes* the connection?
Thanks a lot! Natalia.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---