Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
made getNodeById a non-ui-thread call
Browse files Browse the repository at this point in the history
  • Loading branch information
jexp committed Jul 3, 2013
1 parent 5cc48f4 commit 560e712
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,21 @@ public Node getAnyReferenceNode() throws Exception
if ( result.isEmpty() ) {
throw new IllegalStateException( "No suitable reference node found in graph" );
}
Number id = (Number) result.get( 0 ).get( "id" );
return lifecycle.graphDb().getNodeById( id.longValue() );
final long id = ((Number) result.get( 0 ).get( "id" )).longValue();
return getNodeById( id );
}

public Node getNodeById( final long id )
{
return executeTask( new GraphCallable<Node>()
{

@Override
public Node call( GraphDatabaseService graphDb )
{
return graphDb.getNodeById( id );
}
}, "retrieving node with id "+id );
}

public boolean isRemote()
Expand Down

0 comments on commit 560e712

Please sign in to comment.