Обсуждение: Question-set Query time out in Locking
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.
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