pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eric Faulhaber <ecf@goldencode.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Implicit autocommit?
Date: Sun, 15 Jul 2007 13:34:30 -0400
Message-ID: <469A5AA6.3090005@goldencode.com> (raw)
In-Reply-To: <4699FFF6.4050506@opencloud.com>
References: <4699BA51.6050001@goldencode.com>
	<4699FFF6.4050506@opencloud.com>

Oliver Jowett wrote:
> Eric Faulhaber wrote:
>
>> I debugged into the driver and found it was issuing a "BEGIN" to the 
>> backend just before each statement.  Why would it do this with 
>> autocommit disabled?
>
> autocommit on = implicit transaction wrapping each individual 
> statement. In the postgres world, this means "don't use BEGIN/COMMIT 
> at all".
>
> autocommit off = explicit transaction demarcation, the first statement 
> executed starts a new transaction that lasts until rollback()/commit() 
> are called. In the postgres world, this means "use 
> BEGIN/ROLLBACK/COMMIT to demarcate the transaction". So the driver 
> issues a BEGIN to start a new transaction as necessary.
>
> -O
Unless I misunderstand your answer, this suggests that vacuum cannot be 
run via JDBC, since it cannot be run within a transaction block.  It is 
my understanding that autovacuum skips temp tables:

http://archives.postgresql.org/pgsql-general/2007-06/msg01645.php

This is consistent with my experience.  So, how can I vacuum a 
long-lived temp table created with a JDBC connection?

Thanks,
Eric Faulhaber




view thread (5+ messages)  latest in thread

Message-ID: <469A5AA6.3090005@goldencode.com>
Permalink:  ../469A5AA6.3090005@goldencode.com/
Also on:    postgresql.org/message-id/469A5AA6.3090005@goldencode.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: ecf@goldencode.com, oliver@opencloud.com
  Subject: Re: Implicit autocommit?
  In-Reply-To: <469A5AA6.3090005@goldencode.com>
  References: <4699BA51.6050001@goldencode.com> <4699FFF6.4050506@opencloud.com> <469A5AA6.3090005@goldencode.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