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

Поиск
Список
Период
Сортировка
От Matti.Lehtonen@stonesoft.com
Тема DROP TABLE and DROP INDEX hangs up in version 7.1.3, when...
Дата
Msg-id OF89D20B92.9AE711F6-ONC2256ACF.006702A0@stonesoft.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Beta time
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: PostgreSQL funding/organization