pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Question-set Query time out in Locking
2+ messages / 2 participants
[nested] [flat]

* Question-set Query time out in Locking
@ 2004-09-24 05:16  Vasanth Veeraraghavan <vasanth.veeraraghavan@aspiresys.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Vasanth Veeraraghavan @ 2004-09-24 05:16 UTC (permalink / raw)
  To: pgsql-jdbc

Hi!

I wrote a code,for setting querytime out for a querry,which is accessing a locked table.but when the time elapsed,the code is not throwing error.Kindly help me..

OS: windows xp,
DB :postgres
My code is:
st.setQueryTimeout(2); 


rs=st.executeQuery("select * from table1 where column1=2");

Note:table1 is locked.this locking is done by another java code.

Thank you,

Vasanth.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Question-set Query time out in Locking
@ 2004-09-24 10:09  Kris Jurka <books@ejurka.com>
  parent: Vasanth Veeraraghavan <vasanth.veeraraghavan@aspiresys.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2004-09-24 10:09 UTC (permalink / raw)
  To: Vasanth Veeraraghavan <vasanth.veeraraghavan@aspiresys.com>; +Cc: pgsql-jdbc



On Fri, 24 Sep 2004, Vasanth Veeraraghavan wrote:

> I wrote a code,for setting querytime out for a querry,which is accessing
> a locked table.but when the time elapsed,the code is not throwing
> error.Kindly help me..

setQueryTimeout is not implement in the postgresql jdbc driver.  There is
some concern over how to ensure that you only cancel the query you want
the timeout to affect. Using either the Statement.cancel() call or setting
and resetting the server statement_timeout variable look like they are
prone to race conditions, although I have not studied it in detail.

A client application that for example knew it was single threaded could 
use the statement_timeout setting without risking an undesired cancel.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-09-24 10:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-09-24 05:16 Question-set Query time out in Locking Vasanth Veeraraghavan <vasanth.veeraraghavan@aspiresys.com>
2004-09-24 10:09 ` Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox