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 CC687538F9 for ; Fri, 1 Apr 2005 08:17:14 +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 06264-03 for ; Fri, 1 Apr 2005 07:17:13 +0000 (GMT) Received: from vsmtp4.tin.it (vsmtp4.tin.it [212.216.176.224]) by svr1.postgresql.org (Postfix) with ESMTP id A7CA353838 for ; Fri, 1 Apr 2005 08:17:12 +0100 (BST) Received: from casa (80.180.159.66) by vsmtp4.tin.it (7.0.027) (authenticated as giuseppe.sacco17@tin.it) id 424B256A0009A3EC for pgsql-jdbc@postgresql.org; Fri, 1 Apr 2005 09:17:11 +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 1DHGP1-0004b0-IY for pgsql-jdbc@postgresql.org; Fri, 01 Apr 2005 09:17:11 +0200 Subject: Re: DDL in transactions? From: Giuseppe Sacco To: pgsql-jdbc@postgresql.org In-Reply-To: References: <1112254334.3881.8.camel@localhost> Content-Type: text/plain Organization: Giuseppe Sacco Consulting Date: Fri, 01 Apr 2005 09:13:14 +0200 Message-Id: <1112339594.3809.14.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=0.356 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/2 X-Sequence-Number: 12609 Il giorno gio, 31-03-2005 alle 11:09 -0500, Kris Jurka ha scritto: [...] > > My question is: why? Shouldn't DDL be executed immediately? > > No. DDL in postgresql is fully transactable and may be rolled back or > committed. That doesn't explain why the above code doesn't work. > Because the two executeUpdates are on the same Statement on the same > Connection the second execution should see the newly created table because > it is in the same transaction. Perhaps you are not showing us the real > code you are using and you actually have two connections? Hi Kris, you was right: I used two different connections. BTW, is it possible to disable this behaviour and have DDL statement immediately executed? Thanks, Giuseppe