Re: Connection Idle in transaction - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Connection Idle in transaction
Date
Msg-id 4076C31D.20503@xythos.com
Whole thread Raw
In response to Re: Connection Idle in transaction  (Gaetano Mendola <mendola@bigfoot.com>)
Responses Re: Connection Idle in transaction  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Gaetano Mendola wrote:
> Gaetano Mendola wrote:
>> Yes a "idle in transaction" connection for example block each vacuum
>> full, just not to mention all the rows kidnapped by that transaction.
>
>
> Not block sorry, but the vacuum is not able to free all the row updated
> by other connections.
>

I agree that your suggested change in behavior is good (please feel free
to submit a patch), it isn't necessarily going to solve your problem.

 > try to connect to your DB, do a "begin" and leave that transaction
 > sitting there for days...

The problem here is that your application would allow a connection to
the database to sit around for days.  Even with your suggested changes
to the driver, if a jdbc connection did a select (which would start a
transaction) and then left that connection sit arround for days you
would still have the same problem.  Your suggested change to the driver
just delays the point where a connection starts, but if you allow long
lived connections to the database I contend that you will still see your
problem since some code somewhere will simply issue a select and then
hold an open idle connection for long periods of time.

--Barry



pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: cannot connect to db from remote machine
Next
From: Paul Thomas
Date:
Subject: Re: cannot connect to db from remote machine