Re: Upgraded to Django 1.4.1 and now I have one database connection

41 views
Skip to first unread message

Ricardo Grizonic

unread,
Sep 26, 2012, 8:14:26 AM9/26/12
to django...@googlegroups.com
The subject should be:

"Upgraded to Django 1.4.1 and now I have one database connection per thread"

sorry for that! :)

On Wednesday, 26 September 2012 13:34:13 UTC+2, Ricardo Grizonic wrote:
Hey everyone,

I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for every new thread, a new database connection to postgresql is created. I'm using:

from django.db import connection

which, according to the docs, should get a global connection that would be used by all the threads. Anything I might be doing wrong?

Thanks, in advance, for you help!

Tom Evans

unread,
Sep 27, 2012, 7:24:01 AM9/27/12
to django...@googlegroups.com
On Wed, Sep 26, 2012 at 12:34 PM, Ricardo Grizonic
<ricardo....@gmail.com> wrote:
> Hey everyone,
>
> I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for every
> new thread, a new database connection to postgresql is created. I'm using:
>
> from django.db import connection
>
> which, according to the docs, should get a global connection that would be
> used by all the threads. Anything I might be doing wrong?
>
> Thanks, in advance, for you help!
>

I think you are misreading the docs. Each thread or process has its
own database connection.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages