简体   繁体   English

OrientDB:分布式模式下的UPDATE查询结果

[英]OrientDB: UPDATE query result in distributed mode

I have a scheme-less class in my OrientDB, let's say it called 'testClass', it's pretty simple and contains 1 boolean property: 我的OrientDB中有一个无方案的类,假设它称为“ testClass”,它非常简单,包含1个布尔属性:

{
    lock : 'true'
}

When I execute update query via console or web ui: 通过控制台或Web ui执行更新查询时:

update testClass set lock = true

i've got 我有

Updated record(s) '1' in 0.033000 sec(s).

from console and similar result from web ui. 从控制台和类似的结果从Web ui。

The same result i've got when I execute following Java code 执行以下Java代码时得到的结果相同

ODatabaseDocumentTx db = ... // open db connection
Object result = db.command(new OCommandSQL("update testClass set lock = true")).execute()

The 'result' variable is of type Integer and contains number of updated record. “结果”变量的类型为Integer,包含更新记录的数量。

But everything changes when the OrientDB server is started in distributed mode (I have 3 nodes). 但是,当OrientDB服务器以分布式模式启动时(我有3个节点),一切都会改变。 The execution of the same query from console produceds: 从控制台执行相同的查询会产生:

Updated record(s) '[null]' in 0.010000 sec(s).

As you can see, now the result is an array and it's empty. 如您所见,现在的结果是一个数组,它是空的。 The same I've got from Java - the 'result' variable is of type ArrayList and it's empty. 我从Java中得到的结果相同-“结果”变量的类型为ArrayList,并且为空。 The most interesting result shows web ui - when I execute the same query, I've got '[1]' in 'value' column, which means, I guess, that result is array and it contain 1 integer value '1'. 最有趣的结果显示了Web ui-当我执行相同的查询时,在“值”列中有“ [1]”,这意味着,我想这是数组,它包含1个整数值“ 1”。

Is it a feature or a bug? 是功能还是错误? What am I doing wrong? 我究竟做错了什么?

查看指南http://orientdb.com/docs/last/SQL-Update.html尝试此查询更新testClass set lock = true @rid之后返回

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM