pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Idle in Transaction
21+ messages / 13 participants
[nested] [flat]

* Idle in Transaction
@ 2003-01-05 17:00  Jim Downing <jimdowning@pobox.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jim Downing @ 2003-01-05 17:00 UTC (permalink / raw)
  To: pgsql-jdbc

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



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Idle in Transaction
@ 2003-01-06 03:03  Dave Cramer <Dave@micro-automation.net>
  parent: Jim Downing <jimdowning@pobox.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Dave Cramer @ 2003-01-06 03:03 UTC (permalink / raw)
  To: jimdowning@pobox.com; +Cc: pgsql-jdbc

Jim,

I'm just about to start playing with Hibernate, so I'm more than
interested in this.

Does hibernate use connection pools?

Dave
On Sun, 2003-01-05 at 12:00, 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
-- 
Dave Cramer <Dave@micro-automation.net>




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* idle in transaction
@ 2003-03-14 17:14  Alexey Yudichev <Alexey@francoudi.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Alexey Yudichev @ 2003-03-14 17:14 UTC (permalink / raw)
  To: pgsql-jdbc

  It seems that connection.commit() commits current transaction and immediately begins a new one so that connection status is always "idle in transaction". During that time no indicies could be created/dropped, no vaccum command can be issued etc because of locks I suppose. 
  I use PostgreSQL 7.1 and tried 7.2 drivers and 7.3 drivers (with option compatible=7.1).
  Is there anything that can be done to allow creating index without restarting the connection pool?



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2003-03-15 04:02  Barry Lind <blind@xythos.com>
  parent: Alexey Yudichev <Alexey@francoudi.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Barry Lind @ 2003-03-15 04:02 UTC (permalink / raw)
  To: Alexey Yudichev <Alexey@francoudi.com>; +Cc: pgsql-jdbc

Alexey,

A transaction being started doesn't prevent you from creating an index. 
  A lock on a table prevents you from creating an index.  A select 
statement will cause locks on the table it selects from and those locks 
are not released until the transaction is committed.  What I suspect is 
happening in your application (I say this from experience because I 
needed to do a lot of work in my application to avoid this) is the 
following:

You have code that is getting a connection from your connection pool and 
using it only for select operations.  And because you are only doing 
selects you are not commiting or rolling back before returning the 
connection.  But because you aren't commiting or rollingback the locks 
the select aquired are still being held and thus indexes can't be 
created, vacuum full can't be run, etc.

You need to make sure that you always commit/rollback before returning a 
connection to your connection pool (or make sure your connection pool 
does that for you).

thanks,
--Barry


Alexey Yudichev wrote:
>   It seems that connection.commit() commits current transaction and immediately begins a new one so that connection status is always "idle in transaction". During that time no indicies could be created/dropped, no vaccum command can be issued etc because of locks I suppose. 
>   I use PostgreSQL 7.1 and tried 7.2 drivers and 7.3 drivers (with option compatible=7.1).
>   Is there anything that can be done to allow creating index without restarting the connection pool?
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 






^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* idle in transaction
@ 2004-02-15 17:33  Warren Little <wlittle@securitylending.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Warren Little @ 2004-02-15 17:33 UTC (permalink / raw)
  To: pgsql-jdbc

I recently posted this on pgsql-admin and was directed to try this list
as well.

We recently upgraded postgres from 7.3 to 7.4, along with the JDBC jar,
and noticed all the backend processes/connections are left in the "idle
in transaction" state where before they where left in the "idle" state.
Has something changed in the 7.4 jdbc driver vs 7.3 which might be
causing this?
Note
We call setAutoCommit(FALSE) on every connection when created.


-- 
Warren Little
Senior Vice President
Secondary Marketing
Security Lending Wholesale, LC
www.securitylending.com
Tel: 866-369-7763
Fax: 866-849-8082



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2004-02-15 20:32  Oliver Jowett <oliver@opencloud.com>
  parent: Warren Little <wlittle@securitylending.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Oliver Jowett @ 2004-02-15 20:32 UTC (permalink / raw)
  To: Warren Little <wlittle@securitylending.com>; +Cc: pgsql-jdbc

Warren Little wrote:
> I recently posted this on pgsql-admin and was directed to try this list
> as well.
> 
> We recently upgraded postgres from 7.3 to 7.4, along with the JDBC jar,
> and noticed all the backend processes/connections are left in the "idle
> in transaction" state where before they where left in the "idle" state.
> Has something changed in the 7.4 jdbc driver vs 7.3 which might be
> causing this?
> Note
> We call setAutoCommit(FALSE) on every connection when created.

The driver does a "commit; begin" when commit() is called. In an ideal 
world it'd delay the 'begin' until the first statement is executed (and 
batch execution with that statement to avoid an extra roundtrip) but 
currently it doesn't. There is a TODO comment to this effect in the driver.

This area has certainly changed since 7.3, most notably how server-side 
autocommit (not JDBC autocommit) is handled was changed. The 7.3 driver 
appears to have used 'set autocommit = off' with a 7.3 driver vs. a 7.3 
server, but it reverted to using commit;begin in all cases after 
server-side autocommit disappeared again in 7.4.

-O



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2004-02-15 23:51  Warren Little <wlittle@securitylending.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Warren Little @ 2004-02-15 23:51 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc

Oliver,
Thanks for the explanation.
This is consistent with my move from 7.3 to 7.4.  We have a some
erroneous code in our system which is executing some statements and not
closing out the transaction with a proper rollback or commit.  The "idle
in transaction" was revealing this. With the 7.4 implementation I'll
need to dig deeper to find the culprit.

On Mon, 2004-02-16 at 02:32, Oliver Jowett wrote:
> Warren Little wrote:
> > I recently posted this on pgsql-admin and was directed to try this list
> > as well.
> > 
> > We recently upgraded postgres from 7.3 to 7.4, along with the JDBC jar,
> > and noticed all the backend processes/connections are left in the "idle
> > in transaction" state where before they where left in the "idle" state.
> > Has something changed in the 7.4 jdbc driver vs 7.3 which might be
> > causing this?
> > Note
> > We call setAutoCommit(FALSE) on every connection when created.
> 
> The driver does a "commit; begin" when commit() is called. In an ideal 
> world it'd delay the 'begin' until the first statement is executed (and 
> batch execution with that statement to avoid an extra roundtrip) but 
> currently it doesn't. There is a TODO comment to this effect in the driver.
> 
> This area has certainly changed since 7.3, most notably how server-side 
> autocommit (not JDBC autocommit) is handled was changed. The 7.3 driver 
> appears to have used 'set autocommit = off' with a 7.3 driver vs. a 7.3 
> server, but it reverted to using commit;begin in all cases after 
> server-side autocommit disappeared again in 7.4.
> 
> -O
-- 
Warren Little
Senior Vice President
Secondary Marketing
Security Lending Wholesale, LC
www.securitylending.com
Tel: 866-369-7763
Fax: 866-849-8082



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* idle in transaction
@ 2006-09-07 16:38  Sriram Dandapani <sdandapani@counterpane.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Sriram Dandapani @ 2006-09-07 16:38 UTC (permalink / raw)
  To: pgsql-jdbc

Hi

 

We use jboss 4 with the postgresql-8.1-404.jar as the postgres driver
(the database is 8.1.2)

 

I notice a lot of "idle in transaction" processes on the postgres server
box.

 

This causes problems for autovacuum and generally the vacuuming process
and prevents vacuum from completing the run.

 

How can we completely get rid of idle in transaction. We close all
connections (jboss pooling is used).

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2006-09-07 18:02  Dave Cramer <pg@fastcrypt.com>
  parent: Sriram Dandapani <sdandapani@counterpane.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Dave Cramer @ 2006-09-07 18:02 UTC (permalink / raw)
  To: Sriram Dandapani <sdandapani@counterpane.com>; +Cc: pgsql-jdbc

Hi,

This was a problem with older drivers, are you sure this the driver  
being used ?

--dc--
On 7-Sep-06, at 12:38 PM, Sriram Dandapani wrote:

> Hi
>
>
>
> We use jboss 4 with the postgresql-8.1-404.jar as the postgres  
> driver (the database is 8.1.2)
>
>
>
> I notice a lot of “idle in transaction” processes on the postgres  
> server box.
>
>
>
> This causes problems for autovacuum and generally the vacuuming  
> process and prevents vacuum from completing the run.
>
>
>
> How can we completely get rid of idle in transaction. We close all  
> connections (jboss pooling is used).
>
>

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* idle in transaction
@ 2006-09-15 18:47  Sriram Dandapani <sdandapani@counterpane.com>
  0 siblings, 2 replies; 21+ messages in thread

From: Sriram Dandapani @ 2006-09-15 18:47 UTC (permalink / raw)
  To: pgsql-jdbc

I use postgres 8.1.2 database and postgres 8.1.404 jdbc driver .

 

I keep seeing "idle in transaction" connections on the postgres box all
the time. The application logic closes all connections , so it makes me
wonder if the driver is issuing a begin statement after every commit to
leave a floating transaction open.

 

This is causing autovacuum to not finish (and hence I have to frequently
issue database-wide vacuums to prevent the transaction id wraparound
problem)

 

Any help here is appreciated

 

Thanks

 

Sriram

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2006-09-16 08:26  Markus Schaber <schabi@logix-tt.com>
  parent: Sriram Dandapani <sdandapani@counterpane.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Markus Schaber @ 2006-09-16 08:26 UTC (permalink / raw)
  To: Sriram Dandapani <sdandapani@counterpane.com>; +Cc: pgsql-jdbc

Hi, Sriram,

Sriram Dandapani wrote:
> I use postgres 8.1.2 database and postgres 8.1.404 jdbc driver .
> 
> I keep seeing “idle in transaction” connections on the postgres box all
> the time. The application logic closes all connections, so it makes me
> wonder if the driver is issuing a begin statement after every commit to
> leave a floating transaction open.

Current driver versions (and 8.1.404 is current enough) should not show
this behaviour any more, which was annoying in older drivers.

Are you shure that you have the correct driver version? We occasionally
get reports from users thinking they run a certain driver version, but
they accidentally have another driver earlier in the class search path.
Especially the $JRE/lib/ext directory is dangerous, people tend to drop
.jars there and then forget them.

Another possibility is that you use a broken connection pooling that
fails to reset the connections properly. Could you modify your
application logic to set all connections to autocommit mode before
closing / returning them to the pool?

HTH,
Markus




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2006-09-17 15:54  Sriram Dandapani <sdandapani@counterpane.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Sriram Dandapani @ 2006-09-17 15:54 UTC (permalink / raw)
  To: pgsql-jdbc

I use only the postgres 8.1.404 driver(checked that no other drivers
were in the classpath)

I also set autocommit to true before I close the connection. I use jboss
to get the datasource

The autocommit change does not change the behaviour. I still see idle in
transaction.

-----Original Message-----
From: Markus Schaber [mailto:schabi@logix-tt.com] 
Sent: Saturday, September 16, 2006 1:27 AM
To: Sriram Dandapani
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] idle in transaction

Hi, Sriram,

Sriram Dandapani wrote:
> I use postgres 8.1.2 database and postgres 8.1.404 jdbc driver .
> 
> I keep seeing "idle in transaction" connections on the postgres box
all
> the time. The application logic closes all connections, so it makes me
> wonder if the driver is issuing a begin statement after every commit
to
> leave a floating transaction open.

Current driver versions (and 8.1.404 is current enough) should not show
this behaviour any more, which was annoying in older drivers.

Are you shure that you have the correct driver version? We occasionally
get reports from users thinking they run a certain driver version, but
they accidentally have another driver earlier in the class search path.
Especially the $JRE/lib/ext directory is dangerous, people tend to drop
.jars there and then forget them.

Another possibility is that you use a broken connection pooling that
fails to reset the connections properly. Could you modify your
application logic to set all connections to autocommit mode before
closing / returning them to the pool?

HTH,
Markus




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2006-09-18 09:15  João Paulo Ribeiro <jp@mobicomp.com>
  parent: Sriram Dandapani <sdandapani@counterpane.com>
  1 sibling, 0 replies; 21+ messages in thread

From: João Paulo Ribeiro @ 2006-09-18 09:15 UTC (permalink / raw)
  To: Sriram Dandapani <sdandapani@counterpane.com>; +Cc: pgsql-jdbc

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi.<br>
<br>
Are you using DODS/Enhydra to manage your database connection pool?<br>
If yes, see my email in the Enhydra mailing list:<br>
<a class="moz-txt-link-freetext" href="http://mail-archive.objectweb.org/dods/2006-05/msg00000.html">http://mail-archive.objectweb.o...;
<a class="moz-txt-link-freetext" href="http://mail-archive.objectweb.org/dods/2006-06/msg00000.html">http://mail-archive.objectweb.o...;
<br>
The latest DODS dont have this issue anymore. You just use
"RollbackOnReset" option.<br>
<br>
Bests regards.<br>
Jo&atilde;o Paulo Ribeiro<br>
<br>
Sriram Dandapani wrote:
<blockquote
 cite="mid6992E470F12A444BB787B5C937B9D4DF05DF1974@ca-mail1.cis.local"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
  <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
  </style>
  <div class="Section1">
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I use postgres 8.1.2
database and postgres 8.1.404 jdbc
driver .<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I keep seeing &#8220;idle in
transaction&#8221; connections
on the postgres box all the time. The application logic closes all
connections
, so it makes me wonder if the driver is issuing a begin statement
after every
commit to leave a floating transaction open.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">This is causing
autovacuum to not finish (and hence I have
to frequently issue database-wide vacuums to prevent the transaction id
wraparound problem)<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Any help here is
appreciated<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Thanks<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Sriram<o:p></o:p></span></font></p>
  </div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Jo&atilde;o Paulo Ribeiro | Senior Software Engineer
<a class="moz-txt-link-abbreviated" href="mailto:jp@mobicomp.com">jp@mobicomp.com</a>

PHONE: + 351 253 305 250
FAX  : + 351 253 305 250
<a class="moz-txt-link-abbreviated" href="http://www.mobicomp.com">www.mobicomp.com</a;

________________________________________________________________

About Solutions | Wireless World

CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender.
DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.</pre>
</body>
</html>



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2006-09-18 16:02  Sriram Dandapani <sdandapani@counterpane.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Sriram Dandapani @ 2006-09-18 16:02 UTC (permalink / raw)
  To: João Paulo Ribeiro <jp@mobicomp.com>; +Cc: pgsql-jdbc

Hi

 

I use JBOSS 4.0.3 to manage my connection pooling. Is there a way to configure / modify code to take care of this

 

Thanks for your input

 

Sriram

 

________________________________

From: João Paulo Ribeiro [mailto:jp@mobicomp.com] 
Sent: Monday, September 18, 2006 2:15 AM
To: Sriram Dandapani
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] idle in transaction

 

Hi.

Are you using DODS/Enhydra to manage your database connection pool?
If yes, see my email in the Enhydra mailing list:
http://mail-archive.objectweb.org/dods/2006-05/msg00000.html
http://mail-archive.objectweb.org/dods/2006-06/msg00000.html

The latest DODS dont have this issue anymore. You just use "RollbackOnReset" option.

Bests regards.
João Paulo Ribeiro

Sriram Dandapani wrote: 

I use postgres 8.1.2 database and postgres 8.1.404 jdbc driver .

 

I keep seeing "idle in transaction" connections on the postgres box all the time. The application logic closes all connections , so it makes me wonder if the driver is issuing a begin statement after every commit to leave a floating transaction open.

 

This is causing autovacuum to not finish (and hence I have to frequently issue database-wide vacuums to prevent the transaction id wraparound problem)

 

Any help here is appreciated

 

Thanks

 

Sriram






-- 
João Paulo Ribeiro | Senior Software Engineer
jp@mobicomp.com
 
PHONE: + 351 253 305 250
FAX  : + 351 253 305 250
www.mobicomp.com
 
________________________________________________________________
 
About Solutions | Wireless World
 
CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender.
DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: idle in transaction
@ 2006-09-18 16:50  João Paulo Ribeiro <jp@mobicomp.com>
  parent: Sriram Dandapani <sdandapani@counterpane.com>
  0 siblings, 0 replies; 21+ messages in thread

From: João Paulo Ribeiro @ 2006-09-18 16:50 UTC (permalink / raw)
  To: Sriram Dandapani <sdandapani@counterpane.com>; +Cc: pgsql-jdbc

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi.<br>
In a more generic way, you need to garantee 2 things:<br>
1) You always release your connections back to the pool.<br>
2) Any connection released must not have a valid transaction with
resources allocated.<br>
<br>
Its ok to have a connection in the pool with setautocommit(false), that
leads to "idle in connection", if the transaction is a new one and no
resources or lock have been made at the db.<br>
<br>
If you want now what is blocking your vaccum try this:<br>
<br>
SELECT pg_class.relname AS table, pg_database.datname AS database,
transaction, pid, mode, granted FROM pg_locks, pg_class, pg_database
WHERE pg_locks.relation = pg_class.oid AND pg_locks.database =
pg_database.oid order by pg_class.relname, pid;<br>
<br>
You will see in wich table the vaccum is waiting to acquire the lock
and wich process is holding it at the moment.<br>
<br>
Best regards.<br>
Jo&atilde;o Paulo Ribeiro<br>
<br>
Sriram Dandapani wrote:
<blockquote
 cite="mid6992E470F12A444BB787B5C937B9D4DF05DF1A7F@ca-mail1.cis.local"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";
	color:black;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";
	color:black;}
span.EmailStyle17
	{mso-style-type:personal;
	font-family:Arial;
	color:windowtext;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
  </style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  </o:SmartTagType>
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Hi<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I use JBOSS
4.0.3 to manage my connection
pooling. Is there a way to configure / modify code to take care of this<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Thanks for
your input<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Sriram<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt; color: windowtext;">
  <hr tabindex="-1" align="center" size="3" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;">From:</span></font></b><font
 color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;"> Jo&atilde;o
Paulo Ribeiro [<a class="moz-txt-link-freetext" href="mailto:jp@mobicomp.com">mailto:jp@mobicomp.com</a>] <br>
  <b><span style="font-weight: bold;">Sent:</span></b> Monday,
September 18, 2006
2:15 AM<br>
  <b><span style="font-weight: bold;">To:</span></b> Sriram Dandapani<br>
  <b><span style="font-weight: bold;">Cc:</span></b> <st1:PersonName
 w:st="on"><a class="moz-txt-link-abbreviated" href="mailto:pgsql-jdbc@postgresql.org">pgsql-jdbc@postgresql.org</a></st1:PersonName><br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re: [JDBC]
idle in
transaction</span></font><font color="black"><span
 style="color: windowtext;"><o:p></o:p></span></font></p>
  </div>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">Hi.<br>
  <br>
Are you using DODS/Enhydra to manage your database connection pool?<br>
If yes, see my email in the Enhydra mailing list:<br>
  <a href="http://mail-archive.objectweb.org/dods/2006-05/msg00000.html">http://mail-archive.objectweb.o...;
  <a href="http://mail-archive.objectweb.org/dods/2006-06/msg00000.html">http://mail-archive.objectweb.o...;
  <br>
The latest DODS dont have this issue anymore. You just use
"RollbackOnReset" option.<br>
  <br>
Bests regards.<br>
Jo&atilde;o Paulo Ribeiro<br>
  <br>
Sriram Dandapani wrote: <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I use postgres 8.1.2
database and postgres 8.1.404
jdbc driver .<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I keep seeing &#8220;idle in
transaction&#8221;
connections on the postgres box all the time. The application logic
closes all
connections , so it makes me wonder if the driver is issuing a begin
statement
after every commit to leave a floating transaction open.<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">This is causing
autovacuum to not finish (and hence I
have to frequently issue database-wide vacuums to prevent the
transaction id
wraparound problem)<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Any help here is
appreciated<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Thanks<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Sriram<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><br>
  <br>
  <br>
  <o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">-- <o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">Jo&atilde;o Paulo Ribeiro | Senior Software Engineer<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a href="mailto:jp@mobicomp.com">jp@mobicomp.com</a><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">PHONE: + 351 253 305 250<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">FAX&nbsp; : + 351 253 305 250<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a href="http://www.mobicomp.com">www.mobicomp.com</a><o:p></o:p></span></f...;
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">________________________________________________________________<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">About Solutions | Wireless World<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender.<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.<o:p></o:p></span></font></pre>
  </div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Jo&atilde;o Paulo Ribeiro | Senior Software Engineer
<a class="moz-txt-link-abbreviated" href="mailto:jp@mobicomp.com">jp@mobicomp.com</a>

PHONE: + 351 253 305 250
FAX  : + 351 253 305 250
<a class="moz-txt-link-abbreviated" href="http://www.mobicomp.com">www.mobicomp.com</a;

________________________________________________________________

About Solutions | Wireless World

CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender.
DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.</pre>
</body>
</html>



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Idle in Transaction ..
@ 2007-09-25 13:42  Heiko W.Rupp <heiko.rupp@redhat.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Heiko W.Rupp @ 2007-09-25 13:42 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

we ran into an issue that looks like http://osdir.com/ml/ 
db.postgresql.jdbc/2004-04/msg00108.html
We also use a connection pool. The thread indicates that there could  
be some changes in the
jdbc drivers to change the behaviour with autocommit disabled.
Has this been implemented? If so when? Does that need additional  
properties to enable it?
Is that issue also dependent on the server version? I don't think so  
from reading the thread.

Many thanks
   Heiko



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Idle in Transaction ..
@ 2007-09-25 19:24  Heiko W.Rupp <heiko.rupp@redhat.com>
  parent: Heiko W.Rupp <heiko.rupp@redhat.com>
  0 siblings, 2 replies; 21+ messages in thread

From: Heiko W.Rupp @ 2007-09-25 19:24 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

> we ran into an issue that looks like http://osdir.com/ml/ 
> db.postgresql.jdbc/2004-04/msg00108.html
> We also use a connection pool. The thread indicates that there  
> could be some changes in the
> jdbc drivers to change the behaviour with autocommit disabled.
>
I see those implemented in dev302 - did this then automatically make  
its way into
8.0-308 and so on (especially the 8.0-312 driver)?

The icons on the changelog page are unfortunately not clear to me.

Thanks
    Heiko




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Idle in Transaction ..
@ 2007-09-26 11:16  Dave Cramer <pg@fastcrypt.com>
  parent: Heiko W.Rupp <heiko.rupp@redhat.com>
  1 sibling, 2 replies; 21+ messages in thread

From: Dave Cramer @ 2007-09-26 11:16 UTC (permalink / raw)
  To: Heiko W.Rupp <heiko.rupp@redhat.com>; +Cc: pgsql-jdbc

Yes, according to the change log it was fixed in 302.

Why are you using 8.0 anyway ? It's verging on end of life ?

Dave

Heiko W.Rupp wrote:
> Hi,
>
>> we ran into an issue that looks like 
>> http://osdir.com/ml/db.postgresql.jdbc/2004-04/msg00108.html
>> We also use a connection pool. The thread indicates that there could 
>> be some changes in the
>> jdbc drivers to change the behaviour with autocommit disabled.
>>
> I see those implemented in dev302 - did this then automatically make 
> its way into
> 8.0-308 and so on (especially the 8.0-312 driver)?
>
> The icons on the changelog page are unfortunately not clear to me.
>
> Thanks
>    Heiko
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Idle in Transaction ..
@ 2007-09-26 11:22  Devrim GÜNDÜZ <devrim@CommandPrompt.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Devrim GÜNDÜZ @ 2007-09-26 11:22 UTC (permalink / raw)
  To: pg@fastcrypt.com; +Cc: Heiko W.Rupp <heiko.rupp@redhat.com>; pgsql-jdbc

Hi,

On Wed, 2007-09-26 at 07:16 -0400, Dave Cramer wrote:
> Why are you using 8.0 anyway ? It's verging on end of life ?

Only Windows version is going to be EOLed. I just wanted to avoid any
confusion :)

Regards,
-- 
Devrim GÜNDÜZ
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/

Attachments:

  signature.asc (application/pgp-signature, 188B) download

^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Idle in Transaction ..
@ 2007-09-26 14:27  Kris Jurka <books@ejurka.com>
  parent: Heiko W.Rupp <heiko.rupp@redhat.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Kris Jurka @ 2007-09-26 14:27 UTC (permalink / raw)
  To: Heiko W.Rupp <heiko.rupp@redhat.com>; +Cc: pgsql-jdbc



On Tue, 25 Sep 2007, Heiko W.Rupp wrote:

>> we ran into an issue that looks like 
>> http://osdir.com/ml/db.postgresql.jdbc/2004-04/msg00108.html
>> We also use a connection pool. The thread indicates that there could be 
>> some changes in the
>> jdbc drivers to change the behaviour with autocommit disabled.
>> 
> I see those implemented in dev302 - did this then automatically make its way 
> into
> 8.0-308 and so on (especially the 8.0-312 driver)?

Yes, it did.

> The icons on the changelog page are unfortunately not clear to me.
>

The icons simply describe the type of change: update/add/fix/...

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: Idle in Transaction ..
@ 2007-09-26 17:29  Heiko W.Rupp <heiko.rupp@redhat.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Heiko W.Rupp @ 2007-09-26 17:29 UTC (permalink / raw)
  To: pgsql-jdbc


Am 26.09.2007 um 13:16 schrieb Dave Cramer:

> Yes, according to the change log it was fixed in 302.
>
> Why are you using 8.0 anyway ? It's verging on end of life ?
>
Well, it is deployed on running systems at customers (running 8.2.4  
on the backend side).

Unfortunately the customer reported errors and the situation very  
much looks like
that old pre 302 situation. That is why I ask if 312 should have the  
fix (and thus already
be implemented at the customer) or not.

  Thanks
     Heiko



^ permalink  raw  reply  [nested|flat] 21+ messages in thread


end of thread, other threads:[~2007-09-26 17:29 UTC | newest]

Thread overview: 21+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-05 17:00 Idle in Transaction Jim Downing <jimdowning@pobox.com>
2003-01-06 03:03 ` Dave Cramer <Dave@micro-automation.net>
2003-03-14 17:14 idle in transaction Alexey Yudichev <Alexey@francoudi.com>
2003-03-15 04:02 ` Re: idle in transaction Barry Lind <blind@xythos.com>
2004-02-15 17:33 idle in transaction Warren Little <wlittle@securitylending.com>
2004-02-15 20:32 ` Re: idle in transaction Oliver Jowett <oliver@opencloud.com>
2004-02-15 23:51   ` Re: idle in transaction Warren Little <wlittle@securitylending.com>
2006-09-07 16:38 idle in transaction Sriram Dandapani <sdandapani@counterpane.com>
2006-09-07 18:02 ` Re: idle in transaction Dave Cramer <pg@fastcrypt.com>
2006-09-15 18:47 idle in transaction Sriram Dandapani <sdandapani@counterpane.com>
2006-09-16 08:26 ` Re: idle in transaction Markus Schaber <schabi@logix-tt.com>
2006-09-18 09:15 ` Re: idle in transaction João Paulo Ribeiro <jp@mobicomp.com>
2006-09-17 15:54 Re: idle in transaction Sriram Dandapani <sdandapani@counterpane.com>
2006-09-18 16:02 Re: idle in transaction Sriram Dandapani <sdandapani@counterpane.com>
2006-09-18 16:50 ` Re: idle in transaction João Paulo Ribeiro <jp@mobicomp.com>
2007-09-25 13:42 Idle in Transaction .. Heiko W.Rupp <heiko.rupp@redhat.com>
2007-09-25 19:24 ` Re: Idle in Transaction .. Heiko W.Rupp <heiko.rupp@redhat.com>
2007-09-26 11:16   ` Re: Idle in Transaction .. Dave Cramer <pg@fastcrypt.com>
2007-09-26 11:22     ` Re: Idle in Transaction .. Devrim GÜNDÜZ <devrim@CommandPrompt.com>
2007-09-26 17:29     ` Re: Idle in Transaction .. Heiko W.Rupp <heiko.rupp@redhat.com>
2007-09-26 14:27   ` Re: Idle in Transaction .. Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox