[jp@mobicomp.com: Re: Idle in Transaction] -- SOLUTION

From: Jim Downing <jimdowning(at)pobox(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [jp@mobicomp.com: Re: Idle in Transaction] -- SOLUTION
Date: 2003-01-06 15:25:48
Message-ID: 20030106152548.GE30721@pling.qwghlm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

.setAutoCommit(true) solved the problem. I'll go and work out why the
pooling mechanism didn't do this for me...

Thanks to all for your suggestions,

jim

----- Forwarded message from Jo?o Paulo Ribeiro <jp(at)mobicomp(dot)com> -----

Envelope-to: jimdowning(at)qwghlm(dot)org
Delivery-date: Mon, 06 Jan 2003 10:43:19 +0000
Date: Mon, 06 Jan 2003 10:42:46 +0000
From: Jo?o Paulo Ribeiro <jp(at)mobicomp(dot)com>
To: jimdowning(at)pobox(dot)com
Subject: Re: [JDBC] Idle in Transaction

Hi, Jim!

As far as i know when you are using transactions and you do a commit
your transaction is finished but a new one is created immediately.
This new transaction will wait for you information to process and this
is why the postgres porcess will appear as 'Idle in Transaction'.
Im not a guru but as i had seen it seem to be a good ideia to reactivate
de autocommit or do a reset to the connection just before you release
it to the pool.
Some pools do this automatically when you release a coonection but
others do not. You have to check it by your self.
If you do so de the postgres process will not appear as 'Idle in
Transaction'.

I hope i helped.
Regards.
Jo?o Paulo Ribeiro

Jim Downing wrote:

>Hi all,
>
>I have a problem whereby every time my java application tries to
>commit a transaction a new postgresql process is spawned which is
>marked 'Idle in Transaction'. Could anybody tell me what situations
>(in the context of using the jdbc driver) these 'idle in transaction'
>threads are created?
>
>I'm using a persistence framework (Hibernate as it happens), but
>no-one else has had this problem with that framework, so I suspect
>it's something to do with the way I have postgres configured, or else
>my code (looking most likely atm).
>
>Regards,
>
>jim
>
>Jim Downing
>Paribus
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://archives.postgresql.org
>
>
>
>

----- End forwarded message -----

Browse pgsql-jdbc by date

  From Date Subject
Next Message Felipe Schnack 2003-01-06 17:42:33 patches
Previous Message Alan Gutierrez 2003-01-06 10:35:50 Re: 7.3 Prepared statements