X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E6CDB53754 for ; Thu, 31 Mar 2005 08:36:10 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35745-04 for ; Thu, 31 Mar 2005 07:36:06 +0000 (GMT) Received: from vsmtp1.tin.it (vsmtp1.tin.it [212.216.176.141]) by svr1.postgresql.org (Postfix) with ESMTP id 17E3C5373A for ; Thu, 31 Mar 2005 08:36:05 +0100 (BST) Received: from casa (80.180.159.66) by vsmtp1.tin.it (7.0.027) (authenticated as giuseppe.sacco17@tin.it) id 4238611B0061DFCA for pgsql-jdbc@postgresql.org; Thu, 31 Mar 2005 09:36:04 +0200 Received: from eppesuig3wifi ([192.168.2.51] ident=giuseppe) by casa with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.50) id 1DGuDk-0006aN-Mp for pgsql-jdbc@postgresql.org; Thu, 31 Mar 2005 09:36:04 +0200 Subject: DDL in transactions? From: Giuseppe Sacco To: "pgsql-jdbc@postgresql.org" Content-Type: text/plain Organization: Giuseppe Sacco Consulting Date: Thu, 31 Mar 2005 09:32:14 +0200 Message-Id: <1112254334.3881.8.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.078 tagged_above=0 required=5 tests=AWL, TO_ADDRESS_EQ_REAL X-Spam-Level: * X-Archive-Number: 200503/212 X-Sequence-Number: 12604 Hi, I have a question about 7.4 jdbc driver. I am executing this code: -------------------- conn=datasource.getPooledConnection().getConnection(); conn.setAutoCommit(false); stmt=conn.createStatement(); stmt.executeUpdate("CREATE TABLE X (X VARCHAR(100))"); //stmt.commit(); // <= Look at this line stmt.executeUpdate("INSERT INTO X VALUES ('string')"); stmt.commit(); stmt.close(); conn.close(); -------------------- And I found that, using postgresql jdbc driver, I need to add the commit() call that is commented out, otherwise I get an error like 'relation X does not exists'. My question is: why? Shouldn't DDL be executed immediately? Thank you for your response, Giuseppe Sacco