Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 65770632CD3 for ; Thu, 10 Dec 2009 20:36:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 62866-01 for ; Fri, 11 Dec 2009 00:35:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id D49F9631873 for ; Thu, 10 Dec 2009 20:35:58 -0400 (AST) Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id nBB0XpG27151; Thu, 10 Dec 2009 16:33:51 -0800 Message-ID: <4B21936A.9080805@hogranch.com> Date: Thu, 10 Dec 2009 16:33:46 -0800 From: John R Pierce User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-jdbc@postgresql.org Subject: Re: Connection.setReadOnly() References: <4B21737B.50009@hogranch.com> <4B219025.5070607@hogranch.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/14 X-Sequence-Number: 20095 Kris Jurka wrote: > So if they go to the trouble of doing a setReadOnly call, why not > simply do a setAutoCommit(true) call as well? thats pretty much what they'll have to do. I guess setReadOnly() is pretty much a non-op in pg-jdbc? we're having such a problem with Idle in Transaction on this database that I'm looking into writing a process killer that queries pg_stat_activity every 10 minutes and does a pg_terminate_backend() on PIDs older than some arbitrary threshold, maybe an hour. we're still fixing oraclisms in the main application. the developers wanted a mutex on the various 'back end' processes, so they have a thread that connects, and did a lock on a row in a table (one row for each named app that has to be a 1-of), then leave that transaction going.... This works perfectly well on Oracle. On postgresql, 4-5 days later, its painful to see how much bloat is in this 70GB database, and in fact, the autovacuum processes start stacking up on each other and primariy application response time starts shooting up slower and slower til the factory is slowing down, not good.... I've shown them how to use pg_try_advisory_lock() to do the same thing.