pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Csaba Nagy <nagy@ecircle-ag.com>
To: John R Pierce <pierce@hogranch.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: "Idle in Transaction" revisited.
Date: Mon, 20 Sep 2004 10:47:57 +0200
Message-ID: <1095670077.3661.47.camel@localhost.localdomain> (raw)
In-Reply-To: <0f7c01c49d96$cab9dc90$0200a8c0@hogranch.com>
References: <0dfb01c49d0e$5c61c1f0$0200a8c0@hogranch.com>
	<26344.1095464431@sss.pgh.pa.us>
	<0e3701c49d19$e8a90230$0200a8c0@hogranch.com>
	<Pine.BSO.4.56.0409180219260.17711@leary.csoft.net>
	<0f7c01c49d96$cab9dc90$0200a8c0@hogranch.com>

[snip]
> I'm amazed...   Sounds like noone is doing any serious work with JDBC, or 
> only has short lived 'applet' kind of applications where long persistance 
> connections aren't an issue.

In our experience, long running transactions are a PITA for all databases, even if they seam to work fine.
It is always possible to design the work flow so that the transactions are short lived:
 - don't ever open a transaction and then wait for user input;
 - use cooperative locking instead of data base locking for long lived locks;
 - chunk transactions when processing huge amounts of data;

Regarding cooperative locking and the fact that after a crash the lock
stays: I'm not sure how your application is designed, but in ours after
a crash we definitely want it to stay there, so we can manually check
the consistency of the data before releasing the lock for further
processing. I have bad experience with automatic recovery after crashes.

Just my 2c,
Csaba.


> I can think of a bunch of scenarios where this would cause problems...
> 
> *  An service app that opens several connections for various threads,
>    and one or another of them goes idle for a long time ... No vacuuming
>    during this state.
> 
> *  Thread has been idle for awhile, then goes to do a SELECT and it will
>    only see data that was committed prior to this threads last COMMIT.
> 
> etc etc etc. 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org




view thread (28+ messages)  latest in thread

Message-ID: <1095670077.3661.47.camel@localhost.localdomain>
Permalink:  ../1095670077.3661.47.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1095670077.3661.47.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: nagy@ecircle-ag.com, pierce@hogranch.com
  Subject: Re: "Idle in Transaction" revisited.
  In-Reply-To: <1095670077.3661.47.camel@localhost.localdomain>
  References: <0dfb01c49d0e$5c61c1f0$0200a8c0@hogranch.com> <26344.1095464431@sss.pgh.pa.us> <0e3701c49d19$e8a90230$0200a8c0@hogranch.com> <Pine.BSO.4.56.0409180219260.17711@leary.csoft.net> <0f7c01c49d96$cab9dc90$0200a8c0@hogranch.com> <1095670077.3661.47.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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