Re: [PyGreSQL] pg_stat_activity howto

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christoph Zwerschke wrote:

> raf schrieb:
> >that's a worry :) i have a pygresql-using user application
> >(postgres-8.3.7, python-2.6, pygresql-3.8.1) that is always
> >idle in transaction when it is idle. upon connecting, it
> >calls a few database functions, committing after each one.
> >after that, it's idle in transaction until the next bout of
> >db activity.
> >
> >can anyone explain what i'm doing wrong in the attached example?
> 
> One thing is that you should always explicitely close cursors and 
> connections when you do not need them any more.

the cursor should close automatically when the python object
is destroyed. and i need the db connection later so closing
that isn't efficient.

> But the real cause of your problem is that Pygres 3.8.1 used to 
> implicitely start a connection after every commit(). I have improved 
> this already 3 years ago. Please use the current version Pygres 4.0.

ah, so that's the reason. ok, now i have another reason to upgrade.

> -- Christoph

thanks,
raf


-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux