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

From Guido Fiala
Subject Re: setQueryTimeOut(1) - not expected result...
Date
Msg-id 200401290824.16434.guido.fiala@dka-gmbh.de
Whole thread Raw
In response to Re: setQueryTimeOut(1) - not expected result...  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: setQueryTimeOut(1) - not expected result...
List pgsql-jdbc
Am Mittwoch, 28. Januar 2004 22:21 schrieben Sie:
> 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,

As i really need this - maybe i could implement that feature myself and
contribute it here? I assume, it's not much more to set some IO-timeout on
the socket-read() after sending the query...

> but not near the top.

Mmmm, is there any possibility to stop that query using another thread in the
same application?

> 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.

Yes, but wouldn't i then need a lot of connections, one for each data display
in my application?

So far i could'nt really see a need of connection pooling in my app, when does
one start to need them?

Guido


pgsql-jdbc by date:

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