Multi Threading Problem with Python + Django + PostgreSQL.



Hello every body. I am new to this forum and also in Python.
Read many things about multi threading in python. But still having
problem.

I am using Django Framework with Python having PostgreSQL as backend
database with Linux OS. My applications are long running. I am using
threading.
The problem I am facing is that the connections that are being created
for database(postgres) update are not getting closed even though my
threads had returned and updated database successfully. It is not like
that the connections are not being reused. They r being reused but
after sometime new one is created. Like this it creates too many
connections and hence exceeding MAX_CONNECTION limit of postgres conf.

** I am using psycopg2 as adaptor for python to postgres connection.
which itself handles the connections(open/close)

Now the problem is with Django / Python / psycopg2 or any thing else??

HELP ME OUT!!!!!
.



Relevant Pages

  • Re: Multi Threading Problem with Python + Django + PostgreSQL.
    ... Read many things about multi threading in python. ... The problem I am facing is that the connections that are being created ... connections and hence exceeding MAX_CONNECTION limit of postgres conf. ...
    (comp.lang.python)
  • RE: Tracing down segfault
    ... >> consistently segfault. ... > It's especially useful to rebuild Python that way. ... all of the threading module is written ... That exit function called "Destroy" ...
    (comp.lang.python)
  • Re: threads and sleep?
    ... no matter how many CPUs you have, only one will run python code ... As it is probably a core benefit of Python. ... Basically the current state of art in "threading" programming doesn't ... yes Python isn't multithreading well. ...
    (comp.lang.python)
  • Re: 2.6, 3.0, and truly independent intepreters
    ... API client. ... threading and no unnecessary object locking/blocking (ie. the API ... multiple thread is tricky; ... pretty small subset of python). ...
    (comp.lang.python)
  • Re: 2.6, 3.0, and truly independent intepreters
    ... multicore usage (GIL removal) -> OS processes or alternative Python ... WELL on its way to "free threading", ... as visible to you guys (as they are for dev houses like us). ...
    (comp.lang.python)