From: Nathan McEachen <nathan@mceachen.us>
To: pgsql-jdbc@postgresql.org
Subject: Re: DDL hanging when different connection is left open
Date: Mon, 23 Jan 2006 20:36:25 -0700
Message-ID: <43D5A0B9.6000800@mceachen.us> (raw)
In-Reply-To: <43D598C9.2070102@opencloud.com>
References: <43D59563.1040702@mceachen.us>
<43D598C9.2070102@opencloud.com>
Oliver Jowett wrote:
> Nathan McEachen wrote:
>
>> 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() ).
>
>
> Most likely, connection 1 has autocommit off and you have forgotten to
> commit or rollback the transaction that your SELECT opened.
>
Thanks, I *thought* I had checked that, being the thorough and diligent
person that I am. :) However, I am using AspectJ on this project. I
just figured out that I had a faulty pointcut definition. So this was
not a JDBC issue, rather a "Nathan better pay closer attention to how he
defines his pointcut advice" issue. Basically some aspect advice was
preventing the connection from committing, hence connection 2 was hanging.
Sorry for the faulty post.
For all of you AOP people:
public abstract pointcut dumbNathanPosts();
Object around() : dumbNathanPosts()
{
// just ignore what Nathan says. Do not call proceed();
}
-Nathan
--
In theory, there is no difference between theory and practice. But, in practice, there is.
--Jan L.A. van de Snepscheut
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: <43D5A0B9.6000800@mceachen.us>
References: <43D59563.1040702@mceachen.us> <43D598C9.2070102@opencloud.com> <43D5A0B9.6000800@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