1

3 つの属性 { id ,name ,age } を持つクラス Person を考えてみましょう。id は name||age として形成されます。get クエリは Id によってのみ機能します (レコードが作成されたのと同じトランザクションで)

 @Transactional
public void test(String id,String id2 ) {
 personService.save(new Person("abc","123"));
 Person person = repository.findByNameAndAge("abc", "23"); //doesn't work in same transaction
    //however find by Id column works in same transaction works
    repository.findOne("abc||23") 
    }

別のトランザクション呼び出しから repository.findByNameAndAge("abc", "23")結果が返されますが、そのレコードが作成されている同じトランザクションでは、結果は返されません。

リポジトリはこちら

 public interface PersonRepository extends GemfireRepository<RecordRevision, String> {
           List<Person> findByNameAndAge(String name, String age);

リージョンは REPLICATE_PERSISTENT で、PDX シリアライゼーションを使用しています。呼び出しは同じトランザクションでも機能するはずですが、これは既知の問題ですか?

4

1 に答える 1

0

これは、GemFire の既知の制限です [[1]]。クエリ エンジンは、トランザクションの状態を認識しません。ID によるルックアップは、トランザクションの状態を確認できる GemFire の region.get() に変換されます。

[1] http://gemfire.docs.pivotal.io/docs-gemfire/latest/developing/transactions/working_with_transactions.html#concept_ty1_vnt_vk

于 2016-07-08T16:10:14.623 に答える