X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9E4CF329E55 for ; Mon, 20 Sep 2004 09:49:24 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49044-09 for ; Mon, 20 Sep 2004 08:49:18 +0000 (GMT) Received: from webmail.muc.domeus.com (mail.ecircle.de [195.140.186.200]) by svr1.postgresql.org (Postfix) with ESMTP id 4E09D329E17 for ; Mon, 20 Sep 2004 09:49:16 +0100 (BST) Received: from deimos.muc.ecircle.de (deimos.muc.ecircle.de [192.168.1.4]) by webmail.muc.domeus.com (READY) with SMTP id 22140AD4; Mon, 20 Sep 2004 10:49:15 +0200 (CEST) Received: from [192.168.1.110] ([192.168.1.110]) by deimos.muc.ecircle.de with Microsoft SMTPSVC(5.0.2195.6713); Mon, 20 Sep 2004 10:49:24 +0200 Subject: Re: "Idle in Transaction" revisited. From: Csaba Nagy To: John R Pierce Cc: Postgres JDBC 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> <0f7c01c49d96$cab9dc90$0200a8c0@hogranch.com> Content-Type: text/plain Message-Id: <1095670077.3661.47.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 20 Sep 2004 10:47:57 +0200 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Sep 2004 08:49:24.0717 (UTC) FILETIME=[BAD569D0:01C49EEE] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/121 X-Sequence-Number: 11011 [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