Re: [IDLE in TRANSACTION] when I do TOP -c - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: [IDLE in TRANSACTION] when I do TOP -c
Date
Msg-id 43BDC0C6.1080205@opencloud.com
Whole thread Raw
In response to [IDLE in TRANSACTION] when I do TOP -c  (Fabrice.Sznajderman@devoteam.com)
List pgsql-jdbc
Fabrice.Sznajderman@devoteam.com wrote:

> I look the processes on my server where was installed Postgres Database.
> I can saw, when I do top command, many process named : idle in transaction.
>
> What happend with this process? what is the cause of this message?

Each process corresponds to a single client connection to the database.

"idle in transaction" means that connection has a transaction open but
is not currently doing any work. If I had to guess at the cause of this
I'd say that you are using a connection pool and a 7.4 driver.

The JDBC driver would cause these idle transactions itself (mostly
harmlessly) in 7.4 and earlier releases when autocommit was off: a
commit or rollback would automatically start a new transaction even
before any queries had been run.

With 8.0 and later drivers a new transaction is only started when the
first query after a commit or rollback is done, so if you are using
these drivers it probably indicates an application bug where it is not
correctly closing transactions it begins.

-O

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Fw: Re: GROUP_CONCAT in PostgreSQL
Next
From: "hpb@htl-steyr.ac.at"
Date:
Subject: Re: bug in getTime after insertRow with postgresql-8.1-404.jdbc3.jar