pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Transactions not idle but "idle in transaction" since 7.4 and JDBC 7.4.213
2+ messages / 2 participants
[nested] [flat]

* Transactions not idle but "idle in transaction" since 7.4 and JDBC 7.4.213
@ 2004-06-04 07:54  Christian van der Leeden <lists@logicunited.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Christian van der Leeden @ 2004-06-04 07:54 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

	I've upgraded the postgres system to 7.4.2 recently and switched
the JDBC driver to 7.4.213. Now all my transactions are always
"idle in transaction" instead of "idle" (when doing ps -U postgres).
I'm using WebObjects, which will set setAutocommit(true) while doing
selects and just setAutocommit(false) when doing insert/updates.

Is the autocommit feature now implemented in the JDBC adaptor (and not
on the server side)? I couldn't find the logic of doing rollback/commits
on the client side after each expression in AbstractJdbc1Connection.java
(which comes with 7.4.2 distribution).

I'm guessing that transactions being idle in transaction could be the 
cause
of my problem, that postgres is eating away virtual memory (on OSX10.3),
and I'd like to try to get all selects commited or rolled back...

Thanks

Christian


-----------------------------------------------
Christian van der Leeden
Software Engineering

Attachments:

Christian van der Leeden.vcf (text/directory, 531B) download BEGIN:VCARD VERSION:3.0 N:van der Leeden;Christian;;; FN:Christian van der Leeden ORG:Logic United GmbH; TITLE:Software Engineering EMAIL;type=INTERNET;type=HOME;type=pref:next2you@mac.com EMAIL;type=INTERNET;type=WORK:leeden@logicunited.com TEL;type=WORK;type=pref:+49-89-189488-66 TEL;type=CELL:+49-163-3747111 item1.ADR;type=WORK;type=pref:;;Brecherspitzstrasse 8;Muenchen;;81541;Germany item1.X-ABADR:de URL:www.logicunited.com X-AIM;type=HOME;type=pref:next2you X-ICQ;type=WORK;type=pref:13450543 CATEGORY:Buddy,EADS END:VCARD
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: Transactions not idle but "idle in transaction" since
@ 2004-06-05 00:36  Oliver Jowett <oliver@opencloud.com>
  parent: Christian van der Leeden <lists@logicunited.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Oliver Jowett @ 2004-06-05 00:36 UTC (permalink / raw)
  To: Christian van der Leeden <lists@logicunited.com>; +Cc: pgsql-jdbc

Christian van der Leeden wrote:

> Hi,
> 
>     I've upgraded the postgres system to 7.4.2 recently and switched
> the JDBC driver to 7.4.213. Now all my transactions are always
> "idle in transaction" instead of "idle" (when doing ps -U postgres).
> I'm using WebObjects, which will set setAutocommit(true) while doing
> selects and just setAutocommit(false) when doing insert/updates.
> 
> Is the autocommit feature now implemented in the JDBC adaptor (and not
> on the server side)? I couldn't find the logic of doing rollback/commits
> on the client side after each expression in AbstractJdbc1Connection.java
> (which comes with 7.4.2 distribution).

7.3 added a way to disable server-side autocommit; 7.4 removed it again. 
The default server behaviour is autocommit ON, so the JDBC driver does 
extra work to implement autocommit=off (it inserts BEGIN/COMMIT/ROLLBACK 
as needed).

> I'm guessing that transactions being idle in transaction could be the cause
> of my problem, that postgres is eating away virtual memory (on OSX10.3),
> and I'd like to try to get all selects commited or rolled back...

It's probably harmless; the driver does a "COMMIT;BEGIN" or 
"ROLLBACK;BEGIN" when committing or rolling back, so there always 
appears to be a transaction open. Of course it's also possible your app 
really IS leaving the transaction open -- that'd be an application bug.

If you upgrade to the latest CVS driver this behaviour should go away 
(the BEGIN is delayed until the first query is run).

-O




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


end of thread, other threads:[~2004-06-05 00:36 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-04 07:54 Transactions not idle but "idle in transaction" since 7.4 and JDBC 7.4.213 Christian van der Leeden <lists@logicunited.com>
2004-06-05 00:36 ` Re: Transactions not idle but "idle in transaction" since Oliver Jowett <oliver@opencloud.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