Is OCommandSQL done synchronously?

23 views
Skip to first unread message

Erik T

unread,
May 16, 2018, 3:43:24 PM5/16/18
to OrientDB
For this code

OCommandSQL preparedQuery = new OCommandSQL(query);
OrientBaseGraph graph = (OrientBaseGraph) getGraph().getBaseGraph();
return AccessController.doPrivileged((PrivilegedAction<Object>) () -> graph.command(preparedQuery).execute(stationNames));

Is preparedQuery executed synchronously or asynchronously?

Luigi Dell'Aquila

unread,
May 17, 2018, 3:30:05 AM5/17/18
to orient-...@googlegroups.com
Hi Erik,

The query is executed synchronously. The result is returned as soon as all the result set is available.

With the new API (v 3.0) the queries are still synchronous, but the result set is paginated, so the first results are returned as soon as they are available

Thanks

Luigi
 

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Erik T

unread,
May 17, 2018, 6:31:52 AM5/17/18
to orient-...@googlegroups.com
Thanks Luigi.

So what's the difference between OCommandSQL and OSQLSyncQuery? They seem to be the same so why have two classes?

To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/OheQJchmXME/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luigi Dell'Aquila

unread,
May 17, 2018, 7:40:16 AM5/17/18
to orient-...@googlegroups.com
Hi Erik,

The Command is intended for the execution of non-idempotent statements (e.g. UPDATE or INSERT), while the Query can only execute idempotent statements (eg. SELECT, MATCH)

Thanks

Luigi



2018-05-17 12:31 GMT+02:00 Erik T <erik....@gmail.com>:
Thanks Luigi.

So what's the difference between OCommandSQL and OSQLSyncQuery? They seem to be the same so why have two classes?

On Thu, May 17, 2018, 3:30 AM Luigi Dell'Aquila <luigi.de...@gmail.com> wrote:
Hi Erik,

The query is executed synchronously. The result is returned as soon as all the result set is available.

With the new API (v 3.0) the queries are still synchronous, but the result set is paginated, so the first results are returned as soon as they are available

Thanks

Luigi
 
2018-05-16 21:43 GMT+02:00 Erik T <erik....@gmail.com>:
For this code

OCommandSQL preparedQuery = new OCommandSQL(query);
OrientBaseGraph graph = (OrientBaseGraph) getGraph().getBaseGraph();
return AccessController.doPrivileged((PrivilegedAction<Object>) () -> graph.command(preparedQuery).execute(stationNames));

Is preparedQuery executed synchronously or asynchronously?

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/OheQJchmXME/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-database+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages