pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Connection.setReadOnly()
Date: Thu, 10 Dec 2009 16:33:46 -0800
Message-ID: <4B21936A.9080805@hogranch.com> (raw)
In-Reply-To: <alpine.BSO.2.00.0912101922140.16299@leary.csoft.net>
References: <4B21737B.50009@hogranch.com>
	<alpine.BSO.2.00.0912101744080.30821@leary.csoft.net>
	<4B219025.5070607@hogranch.com>
	<alpine.BSO.2.00.0912101922140.16299@leary.csoft.net>

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.







view thread (17+ messages)  latest in thread

Message-ID: <4B21936A.9080805@hogranch.com>
Permalink:  ../4B21936A.9080805@hogranch.com/
Also on:    postgresql.org/message-id/4B21936A.9080805@hogranch.com

 · 

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: pierce@hogranch.com, books@ejurka.com
  Subject: Re: Connection.setReadOnly()
  In-Reply-To: <4B21936A.9080805@hogranch.com>
  References: <4B21737B.50009@hogranch.com> <alpine.BSO.2.00.0912101744080.30821@leary.csoft.net> <4B219025.5070607@hogranch.com> <alpine.BSO.2.00.0912101922140.16299@leary.csoft.net> <4B21936A.9080805@hogranch.com>

* 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