From 470dcb3cc11ed531b53b7a8ad519d86177366ecc Mon Sep 17 00:00:00 2001 From: Dmitriy Tverdiakov <11927660+injectives@users.noreply.github.com> Date: Thu, 24 Nov 2022 19:03:05 +0000 Subject: [PATCH 1/3] Update SessionConfig.withDatabase documentation (#1334) --- .../java/org/neo4j/driver/SessionConfig.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/driver/src/main/java/org/neo4j/driver/SessionConfig.java b/driver/src/main/java/org/neo4j/driver/SessionConfig.java index 99f36a5dfe..684cff617e 100644 --- a/driver/src/main/java/org/neo4j/driver/SessionConfig.java +++ b/driver/src/main/java/org/neo4j/driver/SessionConfig.java @@ -224,16 +224,37 @@ public Builder withDefaultAccessMode(AccessMode mode) { } /** - * Set the database that the newly created session is going to connect to. + * Sets target database name for queries executed within session. *
- * For connecting to servers that support multi-databases, - * it is highly recommended to always set the database explicitly in the {@link SessionConfig} for each session. - * If the database name is not set, then session defaults to connecting to the default database configured in server configuration. + * This option has no explicit value by default, but it is recommended to set one if the target database is + * known in advance. This has the benefit of ensuring a consistent target database name throughout the session + * in a straightforward way and potentially simplifies driver logic as well as reduces network communication + * resulting in better performance. *
- * For servers that do not support multi-databases, leave this database value unset. The only database will be used instead. + * When no explicit name is set, the driver behavior depends on the connection URI scheme supplied to the driver + * on instantiation and Bolt protocol version. + *
+ * Specifically, the following applies: + *
+ * Usage of Cypher clauses like USE is not a replacement for this option. Driver sends Cypher to the server for processing. + *
* When no explicit name is set, the driver behavior depends on the connection URI scheme supplied to the driver * on instantiation and Bolt protocol version. *
From f3132405a00bb66587189319cb4bedd1bb4e0c89 Mon Sep 17 00:00:00 2001 From: Dmitriy Tverdiakov <11927660+injectives@users.noreply.github.com> Date: Fri, 25 Nov 2022 11:16:35 +0000 Subject: [PATCH 3/3] Further update to SessionConfig.withDatabase documentation (#1337) --- .../src/main/java/org/neo4j/driver/SessionConfig.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/driver/src/main/java/org/neo4j/driver/SessionConfig.java b/driver/src/main/java/org/neo4j/driver/SessionConfig.java index ed52cf1e37..5abb9153c1 100644 --- a/driver/src/main/java/org/neo4j/driver/SessionConfig.java +++ b/driver/src/main/java/org/neo4j/driver/SessionConfig.java @@ -226,12 +226,13 @@ public Builder withDefaultAccessMode(AccessMode mode) { /** * Sets target database name for queries executed within session. *
- * This option has no explicit value by default, but it is recommended to set one if the target database is - * known in advance. This has the benefit of ensuring a consistent target database name throughout the session - * in a straightforward way and potentially simplifies driver logic as well as reduces network communication - * resulting in better performance. + * This option has no explicit value by default, as such it is recommended to set a value if the target database + * is known in advance. This has the benefit of ensuring a consistent target database name throughout the + * session in a straightforward way and potentially simplifies driver logic, which reduces network communication + * and might result in better performance. *
- * Usage of Cypher clauses like USE is not a replacement for this option. Driver sends Cypher to the server for processing. + * Cypher clauses such as USE are not a replacement for this option as Cypher is handled by the server and not + * the driver. *
* When no explicit name is set, the driver behavior depends on the connection URI scheme supplied to the driver * on instantiation and Bolt protocol version.