Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMEOUT keyword in SQL queries #1445

Closed
yojimbo87 opened this issue Apr 18, 2013 · 4 comments
Closed

TIMEOUT keyword in SQL queries #1445

yojimbo87 opened this issue Apr 18, 2013 · 4 comments
Assignees
Milestone

Comments

@yojimbo87
Copy link

SQL queries should have a TIMEOUT keyword where represents time in miliseconds that indicates maximum time until the query should return the entire result.

Discussion:
https://groups.google.com/forum/#!topic/orient-database/7vKwvjFoNyE

@ghost ghost assigned lvca Apr 18, 2013
@lvca
Copy link
Member

lvca commented Apr 18, 2013

Done. I'm testing it right now. I've added the new syntax:

TIMEOUT <ms> [<strategy>]

Where ms is the timeout. 0 (zero) means no timeout. the strategy, optional can be:

  • exception (the default), throws a OTimeoutException when the timeout is reached
  • return, just return the collected result so far

Example:

select from V timeout 1 return

It's the best way to see how many records can fetch in 1 ms. If you execute it multiple time you should see different values with so small timeout.

By default the timeout is taken by global parameter (default=0, no timeout):

COMMAND_TIMEOUT("command.timeout", "Default timeout for commands expressed in milliseconds", Long.class, 0),

If the client declare a timeout > then the server's default, then the server timeout wins.

@Volune
Copy link
Contributor

Volune commented Apr 22, 2013

I was trying the node driver with the last server revision, but I had a deserialization error on server side.

At OCommandRequestTextAbstract.java#L186

    timeoutMs = buffer.getAsLong();
    timeoutStrategy = TIMEOUT_STRATEGY.values()[buffer.getAsByte()];

When streaming a request, is the timeout now mandatory for any kind of request, or is this a mistake ?
These lines seemed strange because there already is the support of the TIMEOUT keyword in the SQL queries.

@lvca
Copy link
Member

lvca commented Apr 22, 2013

Done!

@lvca lvca reopened this Apr 22, 2013
@lvca lvca closed this as completed Apr 22, 2013
@Volune
Copy link
Contributor

Volune commented Apr 22, 2013

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants