Re: user's process shows as "idle in transaction"

Michael Barton <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Mon, Jun 29, 2009 at 2:26 PM, Janet Jacobsen<jsjacobsen-/[email protected]> wrote:
> Is there something missing from his code sample, like a commit or
> a set_isolation_level, that if added would prevent the "idle in
> transaction" from happening?

He could set_isolation_level to ISOLATION_LEVEL_AUTOCOMMIT (in
psycopg2.extensions) to tell psycopg to not start any transactions,
but it'd probably be easier to just do a conn.commit() before the
sleep, or conn.rollback() if he isn't modifying anything.

-Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.