db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Statement.setQueryTimeout() in client/server mode
Date Wed, 27 Jul 2005 13:27:54 GMT
Øystein Grøvlen wrote:

> I agree with Øyvind that we need to distinguish between loosing
> contact with the server and a query timing out.  If the contact is
> lost, the client will not be able to know whether the request
> succeeded or not and have to take actions if it needs to determine
> what has happened.  If the query times out, the server will guarantee
> that the statement is rolled back.
> In other words, I do not think we should use the query timeout to
> determine whether the client is still able to contact the server.  A
> separate keep-alive mechanism should be used for that purpose.

So I agree that setting the embedded query timeout from the client is
the correct thing to do. However I believe according to the definition
of JDBC's query timeout an application would expect these situations
that should cause a timeout.

      - network path to the server is down
      - network path to the server is really slow
      - Request gets held up in derby network server (e.g. waiting for a
worker thread)

Maybe addressing those is another step, incremental development is good
and just setting the engine query timeout from the client is a good
first step. Could setting it be done by a system procedure, rather than
new grammar?

Ovyind also wrote

> This may result in erroneous client behaviour later, and thus, unexpected inconsistencies
in the database (at the application semantic level).

I think's that's true for any exception caused by a communication
failure. In the extreme case a commit from the client could have been
successfully executed at the engine, but the client receives an
exception. Thus the transaction is committed but the client "believes"
the commit failed. Maybe this is handled by the new exception
sub-classing in JDBC 4?


View raw message