X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7F6E09DC83B for ; Mon, 23 Jan 2006 22:54:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07346-09 for ; Mon, 23 Jan 2006 22:55:02 -0400 (AST) X-Greylist: delayed 00:06:41.099744 by SQLgrey- Received: from smtp107.plus.mail.mud.yahoo.com (smtp107.plus.mail.mud.yahoo.com [68.142.206.240]) by postgresql.org (Postfix) with SMTP id E30559DC81A for ; Mon, 23 Jan 2006 22:54:55 -0400 (AST) Received: (qmail 20301 invoked from network); 24 Jan 2006 02:48:19 -0000 Received: from unknown (HELO ?127.0.0.1?) (nmceachen@67.41.117.131 with plain) by smtp107.plus.mail.mud.yahoo.com with SMTP; 24 Jan 2006 02:48:18 -0000 Message-ID: <43D59563.1040702@mceachen.us> Date: Mon, 23 Jan 2006 19:48:03 -0700 From: Nathan McEachen User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: DDL hanging when different connection is left open Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/107 X-Sequence-Number: 14558 In order to execute a DDL statement on a table using a JDBC connection, must all other JDBC connections that have performed a read query on that table be closed? This is what I am seeing: connection1 performes query: "SELECT * FROM my_table"; connection 2 performs DDL: "ALTER TABLE my_table ADD COLUMN my_col INTEGER"; connection 2 seems to hang unless connection1 is closed (i.e. conneciton1.close() ). This is proving to be a problem when I pool my JDBC connections in my application, as connections that are returned to the pool are not closed. I tried chaning the transaction isolation levels through JDBC but that did not change anything. Is there a way for me to keep my JDBC connections open, yet still perform DDL statements? Thanks in advance, -Nathan -- In theory, there is no difference between theory and practice. But, in practice, there is. --Jan L.A. van de Snepscheut