Hi, all.
I use django ORM in multiprocessed parser. I use processing module:
http://pyprocessing.berlios.de/doc/
Each process is a fork of main process and I need to work with DB in
each process.
It is not recommended to use one db connection from all forked
processes, so I want to reinitialize connection to DB  after forking.
Could you help me and show the code that will reconnection to DB?

May be (in each forked process):

    from django.conf import settings
    from django.db import connection
    connection.connection = None
    connection._cursor(settings)

But I am not sure. Does this code do that I want? Does it affect on
connection of parent process? Does it affect on anything? ) What do
you think?

Thanks.

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