Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 402169FB36D for ; Sun, 15 Jul 2007 03:35:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 91314-09 for ; Sun, 15 Jul 2007 03:35:06 -0300 (ADT) X-Greylist: delayed 00:22:51.532509 by SQLgrey-1.7.5 Received: from www.goldencode.com (smtp.goldencode.com [72.17.138.114]) by postgresql.org (Postfix) with ESMTP id 72D579FB323 for ; Sun, 15 Jul 2007 03:35:13 -0300 (ADT) Received: from emlsrv01.internal.goldencode.com (unknown [192.168.1.51]) by www.goldencode.com (Postfix) with SMTP id 50CDC1C141 for ; Sun, 15 Jul 2007 01:14:28 -0400 (EDT) Received: from [192.168.1.103] (ecf.internal.goldencode.com [192.168.1.103]) by emlsrv01.internal.goldencode.com (Hethmon Brothers Smtpd) id 20070715020447-63563-7 ; Sun, 15 Jul 2007 02:04:47 -0500 Message-ID: <4699BA51.6050001@goldencode.com> Date: Sun, 15 Jul 2007 02:10:25 -0400 From: Eric Faulhaber Reply-To: ecf@goldencode.com Organization: Golden Code Development User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Implicit autocommit? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/54 X-Sequence-Number: 17228 I am using postgresql-8.1-408.jdbc3.jar w/ PostgreSQL 8.1.8 on Kubuntu Linux. Given the following testcase (note autocommit is disabled)... --------- BEGIN SOURCE ----------- import java.sql.*; public class VacuumTest { public static void main(String[] args) throws SQLException { Connection conn = null; try { Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection("jdbc:postgresql://localhost/test"); conn.setAutoCommit(false); update(conn, "create temp table tt1 (c1 int4)"); update(conn, "vacuum tt1"); update(conn, "drop table tt1"); } catch (Exception exc) { exc.printStackTrace(); } finally { if (conn != null) { conn.close(); } } } private static void update(Connection conn, String sql) throws SQLException { Statement stmt = conn.createStatement(); try { stmt.executeUpdate(sql); } finally { stmt.close(); } } } ---------- END SOURCE ------------ ...I see the following result: org.postgresql.util.PSQLException: ERROR: VACUUM cannot run inside a transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:286) at VacuumTest.update(VacuumTest.java:38) at VacuumTest.main(VacuumTest.java:16) 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? Thanks, Eric Faulhaber