pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Oliver Jowett <oliver@opencloud.com>
Cc: John R Pierce <pierce@hogranch.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Connection.setReadOnly()
Date: Fri, 11 Dec 2009 22:37:22 +0800
Message-ID: <4B225922.1090705@postnewspapers.com.au> (raw)
In-Reply-To: <4B219D76.1080600@opencloud.com>
References: <4B21737B.50009@hogranch.com>
	<alpine.BSO.2.00.0912101744080.30821@leary.csoft.net>
	<4B219025.5070607@hogranch.com>
	<4B219538.2090203@opencloud.com>
	<4B2198E4.5090306@hogranch.com>
	<4B219D76.1080600@opencloud.com>

Oliver Jowett wrote:
> John R Pierce wrote:
>> Oliver Jowett wrote:
> 
>>> If your oracle developers don't want manually committed transactions,
>>> perhaps they should.. turn on autocommit.
>>>   
>> otherwise, an app thats doing purely read queries has to periodically
>> issue a Commit().   I have to say, doing Commit() on read operations is
>> NOT at all intuitive.
> 
> Maybe not, but it's a fairly well known quirk of Postgresql that
> long-running transactions don't work so well; the JDBC driver is no
> different to any other interface in this regard.

Does Pg have issues with long-running read-only transactions in
read-committed mode? Or are they an exception to the usual "avoid
long-running mostly-idle transactions" guideline?

Pg doesn't have to worry about retaining old rows in vacuum with such a
statement, because each new statement creates a new snapshot, so if it's
idle it effectively has _no_ snapshot and vacuum is free to clear old
rows. It doesn't need to keep track of anything to roll back, since the
transaction is read only.

So ... for READ COMMITTED, READ ONLY transactions, _are_ there any
VACUUM issues?

--
Craig Ringer



view thread (17+ messages)  latest in thread

Message-ID: <4B225922.1090705@postnewspapers.com.au>
Permalink:  ../4B225922.1090705@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4B225922.1090705@postnewspapers.com.au

 · 

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: craig@postnewspapers.com.au, oliver@opencloud.com, pierce@hogranch.com
  Subject: Re: Connection.setReadOnly()
  In-Reply-To: <4B225922.1090705@postnewspapers.com.au>
  References: <4B21737B.50009@hogranch.com> <alpine.BSO.2.00.0912101744080.30821@leary.csoft.net> <4B219025.5070607@hogranch.com> <4B219538.2090203@opencloud.com> <4B2198E4.5090306@hogranch.com> <4B219D76.1080600@opencloud.com> <4B225922.1090705@postnewspapers.com.au>

* 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