DROP TABLE and DROP INDEX hangs up in version 7.1.3, when...

From: Matti(dot)Lehtonen(at)stonesoft(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: DROP TABLE and DROP INDEX hangs up in version 7.1.3, when...
Date: 2001-09-22 19:35:32
Message-ID: OF89D20B92.9AE711F6-ONC2256ACF.006702A0@stonesoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)lehtonen(at)stonesoft(dot)com
Internet: http://www.stonesoft.com/

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2001-09-22 23:48:36 Re: PostgreSQL funding/organization
Previous Message Tom Lane 2001-09-22 15:46:01 Re: Beta time