Make sure you use one connection per thread. Thanks,
Eugene [EMAIL PROTECTED] wrote: > Hi, my name is Rafael Jorge, I'm from Brazil > Well, I was search in the GMane [1] for something like this, but I > haven't found anything that could help me. > > I'm trying run a script that throws (nearly) 50 threads (like robots, > daemons), and this script never finish (yes, this is right), but each > thread use the connection on the database for it interest. > Sometimes the script throws an error at the database, and my "except" > statement print the error, and the SQL command executed by it, so I get > the command throwed, put in the "psql", and....it run!! > > So maybe the Django doesn't work with to many thread?? > > My script is something like it: > > --------------8<------------ > from threading import Thread > from time import sleep > from django import myclasses > > class foo(Thread): > def run(self): > # do something (too much something :-) > > mythread = [] > for i in range(50): > mythread.append(foo()) > mythread[-1].start() > > while True: > sleep(1) #run forever > > -------------->8------------ > > I'm using Python-2.4 with Django-0.91 on Slackware > > # Sorry if my english is too bad...X( > > Best regards...=] > > [1] - http://www.gmane.com > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---