Re: setQueryTimeOut(1) - not expected result... - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: setQueryTimeOut(1) - not expected result...
Date
Msg-id 401827C6.7030003@opencloud.com
Whole thread Raw
In response to setQueryTimeOut(1) - not expected result...  (Guido Fiala <guido.fiala@dka-gmbh.de>)
Responses Re: setQueryTimeOut(1) - not expected result...  (Guido Fiala <guido.fiala@dka-gmbh.de>)
List pgsql-jdbc
Guido Fiala wrote:

> //user1:
>
> stmt.setQueryTimeout(1);//wait just one second
> ResultSet rs=stmt.executeQuery("BEGIN;SELECT * FROM mytable FOR UPDATE OF
> mytable");

[...]

> What am i doing wrong?

You are assuming that setQueryTimeout() is implemented :)  Calling it
does nothing in the current driver. This is on my list of things to fix,
but not near the top.

On another note, it's generally a bad idea to use the transaction
control primitives (BEGIN, COMMIT, ROLLBACK) directly -- use
Connection.setAutoCommit(false) and Connection.commit() /
Connection.rollback() instead.

-O

pgsql-jdbc by date:

Previous
From: "Waldomiro"
Date:
Subject: Re: setQueryTimeOut(1) - not expected result...
Next
From: Kris Jurka
Date:
Subject: Re: Connection problem