pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan McEachen <nathan@mceachen.us>
To: pgsql-jdbc@postgresql.org
Subject: DDL hanging when different connection is left open
Date: Mon, 23 Jan 2006 19:48:03 -0700
Message-ID: <43D59563.1040702@mceachen.us> (raw)


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





view thread (3+ messages)  latest in thread

Message-ID: <43D59563.1040702@mceachen.us>
Permalink:  ../43D59563.1040702@mceachen.us/
Also on:    postgresql.org/message-id/43D59563.1040702@mceachen.us

 · 

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: nathan@mceachen.us
  Subject: Re: DDL hanging when different connection is left open
  In-Reply-To: <43D59563.1040702@mceachen.us>
  References: <43D59563.1040702@mceachen.us>

* 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