}
}
@Test
public void testCreateSubgraphOutsideOfTransactionPersistWithCycle() {
Person michael = new Person("Michael", 35);
Person david = new Person("David", 27);
Person emil = new Person("Emil", 31);
michael.setBoss(emil);
david.setBoss(michael);
emil.setBoss(david);
try (Transaction tx = neo4jTemplate.getGraphDatabase().beginTx()) {
assertEquals(emil, michael.getBoss());
assertEquals(michael, david.getBoss());
assertEquals(david, emil.getBoss());
assertFalse(hasPersistentState(michael));
assertFalse(hasPersistentState(david));
assertFalse(hasPersistentState(emil));
tx.success();
}