Assert.assertEquals(p, personRepository.findByPropertyValue(NAME_INDEX, "name", NAME_VALUE2));
}
@Test
public void testNodeCanbBeIndexedTwiceInDifferentTransactions() {
Transaction tx = null;
final Person p;
try {
tx = neo4jTemplate.getGraphDatabase().beginTx();
p = persistedPerson(NAME_VALUE2, 30);
tx.success();
} finally {
if (tx != null) tx.close();
}
Assert.assertEquals(p, personRepository.findByPropertyValue(NAME_INDEX, "name", NAME_VALUE2));
try {
tx = neo4jTemplate.getGraphDatabase().beginTx();
p.setName(NAME_VALUE);
tx.success();
} finally {
tx.close();
}
Assert.assertEquals(p, personRepository.findByPropertyValue(NAME_INDEX, "name", NAME_VALUE));
try {
tx = neo4jTemplate.getGraphDatabase().beginTx();
p.setName(NAME_VALUE2);
tx.success();
} finally {
tx.close();
}
Assert.assertEquals(p, personRepository.findByPropertyValue(NAME_INDEX, "name", NAME_VALUE2));