Skip to content

Commit

Permalink
Normalize database name to lowercase on client to avoid creating mult…
Browse files Browse the repository at this point in the history
…iple routing tables for the same database
  • Loading branch information
Zhen Li committed Jul 22, 2019
1 parent 97b1532 commit 5b7f678
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion driver/src/main/java/org/neo4j/driver/SessionConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ public Builder withDatabase( String database )
// Disallow users to use bolt internal value directly. To users, this is totally an illegal database name.
throw new IllegalArgumentException( String.format( "Illegal database name '%s'.", database ) );
}
this.database = database;
// The database name is normalized to lowercase on the server side.
// The client in theory shall not perform any normalization at all.
// However as this name is also used in routing table registry as the map's key to find the routing table for the given database,
// to avoid multiple routing tables for the same database, we perform a client side normalization.
this.database = database.toLowerCase();
return this;
}

Expand Down

0 comments on commit 5b7f678

Please sign in to comment.