DROP TABLE and DROP INDEX hangs up in version 7.1.3, when... - Mailing list pgsql-hackers

From Matti.Lehtonen@stonesoft.com
Subject DROP TABLE and DROP INDEX hangs up in version 7.1.3, when...
Date
Msg-id OF89D20B92.9AE711F6-ONC2256ACF.006702A0@stonesoft.com
Whole thread Raw
List pgsql-hackers
Hi!

FYI: a nasty mistake... :)

I am writing a java application, which uses postgreSQL thru JDBC2.

I have two connections to database;
a batch connection, which is initialized as                   realConnection.setAutoCommit( false );
realConnection.setTransactionIsolation(
realConnection.TRANSACTION_READ_COMMITTED );

a query connection, which was initialized as                   realConnection.setAutoCommit( false );
realConnection.setTransactionIsolation(
realConnection.TRANSACTION_READ_COMMITTED );                   realConnection.setReadOnly( true );

Well everything was okay, until I started to drop tables and indexes... :(
Drop statements did hangup for forever when backend did try to take
exclusive accss lock of index or table.

I used these connections as
batch: created table&indexes. Initialized table with some data
query: make several queries
batch: cleanup and drop indexes&table

After couple of days, I did finally found the *real* reason for hangup...
The query connection is not set to be an autocommitted, however, I didn't
use any connection.commit(). The rest you can imagine... ;-)

Now everything works fine, when I put autocommit on for query connection.


Matti "a bit smarter" Lehtonen
--
Matti Lehtonen   Software designer,   Stonesoft Corp.   Networks R&D
Addr: Itälahdenkatu 22 A,   FIN-00210 Helsinki
Mobile: +358 40 750 4969   Fax: +358 9 4767 1345
E-mail: matti.lehtonen@stonesoft.com
Internet: http://www.stonesoft.com/




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Beta time
Next
From: "Marc G. Fournier"
Date:
Subject: Re: PostgreSQL funding/organization