0

私は自分のマシンで「データストア」を試していました。このコードを使用します。

            Key parentKey = KeyFactory.createKey("parent", "parentId");
            try {
    //          Entity parent = new Entity("parent", "parentId");
    //          parent.setUnindexedProperty("property1", "value1");
    //          ds.put(parent);
                Entity savedParent = ds.get(parentKey);
    //          savedParent.setUnindexedProperty("property1", "value3");
    //          ds.put(savedParent);
    //          Entity child = new Entity("child", "childId", savedParent.getKey());
                Entity child = ds.get(KeyFactory.createKey(savedParent.getKey(), "child", "childId"));
                child.setUnindexedProperty("property1", "val2");
                ds.put(child);
    //          logger.info("Saved child.");
            } catch (EntityNotFoundException e) {
                throw new RuntimeException(e);
            }

最初に親エンティティを保存し、そのプロパティを「value2」に設定してから、プロパティ val1 を持つ子エンティティを追加しました。次に、親プロパティを value3 に更新しました。次に、子のプロパティを val2 に更新しました。次に、管理コンソールで、親のプロパティの値が value2 に戻っていることがわかりました。もう一度繰り返しましたが、同じ結果でした。何か不足していますか?それともこれは何かのバグですか?

4

1 に答える 1

0

これは結果整合性の現れだと思いますよね?新しいJVMインスタンスで各ステップを実行し、スイッチをオフにしたときに値が格納されている必要があると考えています。常識に反しますが、結果整合性のエミュレーションに関しては正しいです。

于 2013-01-28T00:17:26.647 に答える