graph.autoStartTransaction(false);
if (!checkTransaction) {
return new Neo4j2Edge(this.itty.next(), graph);
} else {
if (null != this.nextRelationship) {
final Relationship temp = this.nextRelationship;
this.nextRelationship = null;
return new Neo4j2Edge(temp, graph);
} else {
while (true) {
final Relationship relationship = this.itty.next();
try {
if (!graph.relationshipIsDeleted(relationship.getId())) {
return new Neo4j2Edge(relationship, graph);
}
} catch (final IllegalStateException e) {
// tried to access a relationship not available to the transaction
}
}
}
}
}
public boolean hasNext() {
graph.autoStartTransaction(false);
if (!checkTransaction)
return this.itty.hasNext();
else {
if (null != this.nextRelationship)
return true;
else {
while (this.itty.hasNext()) {
final Relationship relationship = this.itty.next();
try {
if (!graph.relationshipIsDeleted(relationship.getId())) {
this.nextRelationship = relationship;
return true;
}
} catch (final IllegalStateException e) {
}