25.02.2017 14:03, Mark Rotteveel wrote:

> The problem I foresee is that if I implement this in Jaybird, that I am
> going to get confused or irate Jaybird users, who either expect the
> timeout only to be applied to the execute, or only on 'time spent
> waiting for the server'.
>
> From the perspective of JDBC the statement query timeout is to be
> applied to the execute, and optionally for result set method calls. The
> wording in the specification is a bit vague, but the expectation is that
> the timeout is applied to each method individually.

We looked at the setQueryTimeout() in JDBC while developing this 
feature. The first description I googled right now:

"The Java Database Connectivity (JDBC) API provides a standard interface 
java.sql.Statement.setQueryTimeout to limit the number of seconds a JDBC 
driver waits for a statement to execute. This is used by an application 
to control the maximum amount of time the application waits for an SQL 
statement to complete before the request is interrupted."

First of all, "time the application waiting for the statement to 
complete" looks to me as surely including network delays and is not 
limited to the server-side time consumption. It obviously means the time 
elapsed from the application POV.

Secondly, it says about statement execution. The problem is that it 
doesn't necessarily mean execute(). I understand that JDBC users may not 
expect the database "executing" the query while calling fetchNext(), but 
this is how Firebird behaves. Any trivial select will be "completed" 
only after the last row is fetched. From another side, the application 
won't be "waiting" until that happens, it will be busy fetching rows.

What I can say is that the standard definition does not absolutely match 
Firebird and thus should be taken with a grain of salt. If JDBC users 
really expect execute() to do all the job, then you should be fetching 
and caching the entire result set inside Jaybird's execute() thus 
keeping them in happy ignorance. But I doubt you do that. We need to 
find some compromise.


Dmitry


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to