Re: setQueryTimeOut(1) - not expected result...

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Guido Fiala <guido(dot)fiala(at)dka-gmbh(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: setQueryTimeOut(1) - not expected result...
Date: 2004-01-28 21:21:10
Message-ID: 401827C6.7030003@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-01-28 23:07:46 Re: Connection problem
Previous Message Dave Page 2004-01-28 20:15:16 FW: [webmaster] jdbc site: documentation links broken