Hi Luca, 

Sorry, the syntax was copied from ruby, the #{} syntax is interpolation. 
this is basically being translated into something like: 

["LET $buyer_vertex = UPDATE User CONTENT {id: 1, name: 'alex' } UPSERT RETURN 
AFTER @rid WHERE id=1",                    "LET $seller_vertex = UPDATE User 
CONTENT {id: 2, name: 'luca' } UPSERT RETURN AFTER @rid WHERE id=2","LET $order 
= UPDATE Order CONTENT {id: 3, amount: 20} UPSERT RETURN AFTER @rid WHERE 
id=3", "DELETE EDGE FROM $buyer_vertex to $order","DELETE EDGE FROM 
$seller_vertex to $order","CREATE EDGE bought FROM $buyer_vertex TO 
$order","CREATE EDGE sold FROM $seller_vertex TO $order"]


I am using the Rest API through a ruby interface (not jruby) - but the 
language does not really matter, for the sake of the argument, i am doing a 
POST to /batch route with the following hash: 


data = { 'transaction': true, 'operations': [ { 'type': 'script', 'language': 
'sql', 'script': ['begin'] | commands | ['commit retry 200'] } ] }

basically using the ruby gem from: 

https://github.com/veny/orientdb4r

I also see now that the gem supports gremlin commands via REST...is there a 
better way to implement this with gremlin? Do you have any idea why this 
exception occurs? 

Thanks, 
Alex 

On Thursday, April 9, 2015 at 6:27:04 PM UTC+3, [email protected] wrote:
>
> Hi,
>
> I am using REST API against version 2.0.6 of orientdb. 
> I am running in a 3 node cluster. 
> hazelcast configuration:
>
> <hazelcast
>         xsi:schemaLocation="http://www.hazelcast.com/schema/config 
> hazelcast-config-3.0.xsd"
>         xmlns="http://www.hazelcast.com/schema/config"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>         <group>
>                 <name>graph</name>
>                 <password>*****@</password>
>         </group>
>         <network>
>                 <port auto-increment="true">2434</port>
>                 <join>
>                         <multicast enabled="false">
>                                 <multicast-group>235.1.1.1</multicast-group>
>                                 <multicast-port>2434</multicast-port>
>                         </multicast>
>                         <tcp-ip enabled="true">
>                                 
> <member>orientdb01:2434</member><member>orientdb02:2434</member><member>orientdb03:2434</member>
>                         </tcp-ip>
>                 </join>
>         </network>
>         <executor-service>
>                 <pool-size>16</pool-size>
>         </executor-service>
> </hazelcast>
>
> the default-distributed-dg-config.json:
>
> {
>     "autoDeploy": true,
>     "hotAlignment": true,
>     "executionMode": "asynchronous",
>     "readQuorum": 1,
>     "writeQuorum": 2,
>     "failureAvailableNodesLessQuorum": false,
>     "readYourWrites": true,
>     "clusters": {
>         "internal": {
>         },
>         "index": {
>         },
>         "*": {
>             "servers" : [ "orientdb01","orientdb02","orientdb03","<NEW_NODE>" 
> ]
>         }
>     }
> }
>
> when trying to run a batch sql command that looks like this:
>
> ["LET $buyer_vertex = UPDATE User CONTENT #{json_for_buyer} UPSERT RETURN 
> AFTER @rid WHERE id=#{buyer.id}",                    "LET $seller_vertex = 
> UPDATE User CONTENT #{json_for_seller} UPSERT RETURN AFTER @rid WHERE 
> id=#{seller.id}","LET $order = UPDATE Order CONTENT #{json_for_order} UPSERT 
> RETURN AFTER @rid WHERE id=#{order.id}", "DELETE EDGE FROM $buyer_vertex to 
> $order","DELETE EDGE FROM $seller_vertex to $order","CREATE EDGE bought FROM 
> $buyer_vertex TO $order","CREATE EDGE sold FROM $seller_vertex TO $order"]
>
> getting exception:
>
> 2015-04-09 10:13:13:387 WARNING [orientdb01] detected 2 node(s) in timeout or 
> in conflict and quorum (3) has not been reached, rolling back changes for 
> request (id=504320 from=orientdb01 task=command_sql(DELETE EDGE FROM 
> $buyer_vertex to $order) userName=) [ODistributedResponseManager]
> 2015-04-09 10:13:13:387 WARNING [orientdb01] Quorum 3 not reached for request 
> (id=504320 from=orientdb01 task=command_sql(DELETE EDGE FROM $buyer_vertex to 
> $order) userName=). Timeout=9ms Servers in timeout/conflict are:
>  - orientdb02: 
> com.orientechnologies.orient.core.exception.OCommandExecutionException: Error 
> on execution of command: sql.DELETE EDGE FROM $buyer_vertex to $order
>  - orientdb03: 
> com.orientechnologies.orient.core.exception.OCommandExecutionException: Error 
> on execution of command: sql.DELETE EDGE FROM $buyer_vertex to $order
> Received: 
> {orientdb02=com.orientechnologies.orient.core.exception.OCommandExecutionException:
>  Error on execution of command: sql.DELETE EDGE FROM $buyer_vertex to $order, 
> orientdb01=com.orientechnologies.orient.core.exception.OCommandExecutionException:
>  Error on execution of command: sql.DELETE EDGE FROM $buyer_vertex to $order, 
> orientdb03=com.orientechnologies.orient.core.exception.OCommandExecutionException:
>  Error on execution of command: sql.DELETE EDGE FROM $buyer_vertex to $order} 
> [ODistributedResponseManager]
>
> any ideas? this is holding us from going to production with the 
> database....
>

-- 

--- 
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.

Reply via email to