What version of OrientDB are you using? I am using version 2.2.30, and when
I try to run your example script in Studio I get:
com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException:
Cannot find a command executor for the command request: sql.begin let a =
insert into class content {"blah": "blah1"} let b = insert into class
content {"blah": "blah2"} let c = insert into class content {"blah":
"blah3"} commit retry 100 return [$a,$b,$c] DB name="df"
I also tried to run it through PyOrient (I have to use pyOrient
unfortunately at the moment) with the following script:
from __future__ import print_function, unicode_literals
import pyorient
client = pyorient.OrientDB("localhost", 2424)
try:
client.connect(<username>, <password>)
client.db_open("df", <username>, <password>)
except:
print({"message": "Unauthorised"},403)
query = """begin;let a = insert into u_df_product content {"blah":
"blah1" };let b = intest into u_df_product content {"blah": "blah2" };let c
= insert into u_df_product content {"blah" : "blah3"};commit retry 100;
return [$a, $b, $c];"""
print(query)
working_query = """ select from u_df_product where name = "name" """
res = client.query(working_query)
print (res)
res = client.batch(query)
print(res)
Which causes my socket to time out:
Traceback (most recent call last):
File "~/.PyCharmCE2018.1/config/scratches/scratch_2.py", line 20, in
<module>
res = client.batch(query)
File
"~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/orient.py",
line 466, in batch
.prepare(( QUERY_SCRIPT, ) + args).send().fetch_response()
File
"~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/messages/commands.py",
line 144, in fetch_response
super( CommandMessage, self ).fetch_response()
File
~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/messages/base.py",
line 265, in fetch_response
self._decode_all()
File
"~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/messages/base.py",
line 249, in _decode_all
self._decode_header()
File
"~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/messages/base.py",
line 176, in _decode_header
serialized_exception = self._decode_field( FIELD_STRING )
File
"~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/messages/base.py",
line 366, in _decode_field
_decoded_string = self._orientSocket.read( _len )
File
"~/anaconda3/envs/ever/lib/python2.7/site-packages/pyorient/orient.py",
line 167, in read
n_bytes = self._socket.recv_into(view, _len_to_read)
socket.timeout: timed out
On Wednesday, May 2, 2018 at 8:15:21 AM UTC+2, [email protected] wrote:
>
> Hi,
>
> I tried this in OrientDB Studio:
>
> begin
> let a = insert into class content {"blah": "blah1"}
> let b = insert into class content {"blah": "blah2"}
> let c = insert into class content {"blah": "blah3"}
> commit retry 100
> return [$a,$b,$c]
>
> this is the output
>
>
> <https://lh3.googleusercontent.com/-tds3EmWKtps/WulXXobF0hI/AAAAAAAAAEU/EAA2zXCHh6c8PBkM_hUXlYge3koAcDLKQCLcBGAs/s1600/Cattura.PNG>
>
> Hope it helps
>
> Regards,
>
> Michela
>
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.