Inconsistency in Batch-request?

#1

While experimenting with »update … upsert « I ran into a sudden inconsistency

In Studio, inserting via update… upsert works perfect.

 Update test_model set a = 5 , b = 7 upsert return after @rid where c = 8
--> #33:0 

However, using a Batch-Request with the REST-API the result is different (ActiveOrient console)

ORD.create_vertex_class :test_model
30.03.(07:46:54) INFO->CREATE CLASS test_model EXTENDS V
ORD.execute(raw: true) { "Update test_model set a = 5 , b = 7 upsert return after @rid  where c = 10 " }
30.03.(07:50:13) INFO->Update test_model set a = 5 , b = 7 upsert return after @rid  where c = 10 
 => [{"@type"=>"d", "@rid"=>"#27:-2", "@version"=>0, "@class"=>"test_model"}] 

ORD.execute(raw: true) { “Update test_model set a = 5 , b = 7 upsert return after @rid where c = 10 " }
30.03.(07:51:19) INFO->Update test_model set a = 5 , b = 7 upsert return after @rid where c = 10
=> [{”@type"=>“d”, “@rid”=>"#27:0", “@version”=>0, “@class”=>“test_model”}]

Updating the dataset returns the correct rid, if a dataset is inserted, an invalid rid ( #27:-2) is returned.
Is this intentional?

0 Likes

#2

Hi @topo

maybe it’s doing it in a transaction (so it gets a temporary RID before the tx is committed)?
Unfortunately I don’t know the internals of ActiveOrient, so I don’t know how the request is performed…

Thanks

Luigi

0 Likes