Skip to content

Commit

Permalink
fixes neo4j-contrib#1606 add database name when calling dbms.cluster.…
Browse files Browse the repository at this point in the history
…role
  • Loading branch information
sarmbruster committed Aug 5, 2020
1 parent baf6dad commit e5e1c70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/apoc/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,8 @@ public static boolean isWriteableInstance(GraphDatabaseAPI db) {
/* ignore */
}

String role = db.executeTransactionally("CALL dbms.cluster.role()", Collections.emptyMap(),
String role = db.executeTransactionally("CALL dbms.cluster.role($databaseName)",
Collections.singletonMap("databaseName", db.databaseName()),
result -> Iterators.single(result.columnAs("role")));
return role.equalsIgnoreCase("LEADER");
} catch(QueryExecutionException e) {
Expand Down

0 comments on commit e5e1c70

Please sign in to comment.