Re: PrepareStatement.execute() blocked because of long time'create index' operation, connection leak - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: PrepareStatement.execute() blocked because of long time'create index' operation, connection leak
Date
Msg-id CADK3HHJL0G=FMMeXG_eqEpmTTdOiXkVQJnpqvST7FiD3sAOECA@mail.gmail.com
Whole thread Raw
In response to PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak  ("jingzhi.zhang@outlook.com" <jingzhi.zhang@outlook.com>)
Responses Re: PrepareStatement.execute() blocked because of long time'create index' operation, connection leak
Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak
List pgsql-jdbc
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 by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak
Next
From: "jingzhi.zhang@outlook.com"
Date:
Subject: Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak