Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak

Поиск
Список
Период
Сортировка
От jingzhi.zhang@outlook.com
Тема Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak
Дата
Msg-id BLU436-SMTP10CA25E9CF37A72471EF6EF95D0@phx.gbl
обсуждение исходный текст
Ответ на Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
Hi Dave,


Thanks:) 
But I need to clarify the question:

Because of the ‘create index’ sql statement execution (via jdbc) last nearly 30 minutes, the execute() method blocked forever.
At pg server side, about 30 minutes later, 'create index’ successfully finished. Then the connection state change to ‘idle’.
From jdbc client side, it seems ‘create index’ have not finished, but actually the operation already finished at server side.
This cause the client thread blocked and connection leak.


在 2016年6月7日,19:21,Dave Cramer <pg@fastcrypt.com> 写道:

There is a cancel statement, but I presume you want the create index to succeed. You may have to execute the execute() in a background thread to not block  the main thread


On 6 June 2016 at 12:25, jingzhi.zhang@outlook.com <jingzhi.zhang@outlook.com> wrote:
Hi,


I use jdbc  to create index on a table, the sql of 'create index' cost about 30 minutes.
Finally I found, the jdbc client thread blocked at PrepareStatement.execute(), not finished.
At server side, query pg_stat_activity, the connection state already be ‘idle’ (index creation finished).

Is there any suggestion? How to deal with the client thread blocking (read for a response message?) and connection leak.


Thanks a lot.




В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: How to properly convert PostgreSQL timestamp to Java xsd:dateTime
Следующее
От: "jingzhi.zhang@outlook.com"
Дата:
Сообщение: Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak