获取查询仅适用于同一事务内的 Id 列

Get queries work only on Id column inside same transaction

考虑一个 class 具有 3 个属性 { id ,name ,age } 的人 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") return 结果,但在创建该记录的同一事务中,它没有 return 任何结果。

这里是存储库

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

区域是REPLICATE_PERSISTENT,我正在使用PDX序列化 即使在同一个事务中调用也应该有效,这是已知问题吗?

这是 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