Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.4' into 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed May 16, 2019
2 parents 3ecf366 + 0e975f6 commit 813b309
Showing 1 changed file with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ void lockAllNodesAndConsumeRelationships( long nodeId, final Transaction transac
//if the node is not there, someone else probably deleted it, just ignore
if ( nodes.next() )
{
RelationshipSelectionCursor rels =
RelationshipSelections.allCursor( transaction.cursors(), nodes, null );
boolean first = true;
while ( rels.next() && !retry )
try ( RelationshipSelectionCursor rels =
RelationshipSelections.allCursor( transaction.cursors(), nodes, null ) )
{
retry = performAction( rels.relationshipReference(), first );
first = false;
boolean first = true;
while ( rels.next() && !retry )
{
retry = performAction( rels.relationshipReference(), first );
first = false;
}
}
}
}
Expand All @@ -97,17 +99,19 @@ private void collectAndSortNodeIds( long nodeId, Transaction transaction, NodeCu
this.sortedNodeIds = EMPTY;
return;
}
RelationshipSelectionCursor rels =
RelationshipSelections.allCursor( transaction.cursors(), nodes, null );
while ( rels.next() )
try ( RelationshipSelectionCursor rels =
RelationshipSelections.allCursor( transaction.cursors(), nodes, null ) )
{
if ( firstRelId == NO_SUCH_RELATIONSHIP )
while ( rels.next() )
{
firstRelId = rels.relationshipReference();
}
if ( firstRelId == NO_SUCH_RELATIONSHIP )
{
firstRelId = rels.relationshipReference();
}

nodeIdSet.add( rels.sourceNodeReference() );
nodeIdSet.add( rels.targetNodeReference() );
nodeIdSet.add( rels.sourceNodeReference() );
nodeIdSet.add( rels.targetNodeReference() );
}
}

this.sortedNodeIds = nodeIdSet.toSortedArray();
Expand Down

0 comments on commit 813b309

Please sign in to comment.