Skip to content

Commit 47478f3

Browse files
committed
remove excessive routing
1 parent 505b243 commit 47478f3

File tree

7 files changed

+3
-40
lines changed

7 files changed

+3
-40
lines changed

packages/bolt-connection/src/connection-provider/connection-provider-routing.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,6 @@ export default class RoutingConnectionProvider extends PooledConnectionProvider
297297
})
298298
}
299299

300-
async ensureFreshRoutingTable ({ database, accessMode }) {
301-
const context = { database: database || DEFAULT_DB_NAME }
302-
303-
await this._freshRoutingTable({
304-
accessMode,
305-
database: context.database,
306-
onDatabaseNameResolved: (databaseName) => {
307-
context.database = context.database || databaseName
308-
}
309-
})
310-
}
311-
312300
async verifyConnectivityAndGetServerInfo ({ database, accessMode }) {
313301
const context = { database: database || DEFAULT_DB_NAME }
314302

packages/core/src/connection-provider.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ class ConnectionProvider {
110110
throw Error('Not implemented')
111111
}
112112

113-
ensureFreshRoutingTable (param?: { database?: string, accessMode?: string }): Promise<void> {
114-
throw Error('Not implemented')
115-
}
116-
117113
/**
118114
* This method verifies the connectivity of the database by trying to acquire a connection
119115
* for each server available in the cluster.

packages/core/src/driver.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,6 @@ class Driver {
868868
const sessionMode = Session._validateSessionMode(defaultAccessMode)
869869
const connectionProvider = this._getOrCreateConnectionProvider()
870870
const homeDatabase = this.homeDatabaseCache.get(impersonatedUser ?? auth?.principal ?? '')
871-
if (homeDatabase !== undefined && homeDatabase !== '') {
872-
void connectionProvider.ensureFreshRoutingTable({ database: homeDatabase })
873-
}
874871
const bookmarks = bookmarkOrBookmarks != null
875872
? new Bookmarks(bookmarkOrBookmarks)
876873
: Bookmarks.empty()

packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-routing.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,6 @@ export default class RoutingConnectionProvider extends PooledConnectionProvider
297297
})
298298
}
299299

300-
async ensureFreshRoutingTable ({ database, accessMode }) {
301-
const context = { database: database || DEFAULT_DB_NAME }
302-
303-
await this._freshRoutingTable({
304-
accessMode,
305-
database: context.database,
306-
onDatabaseNameResolved: (databaseName) => {
307-
context.database = context.database || databaseName
308-
}
309-
})
310-
}
311-
312300
async verifyConnectivityAndGetServerInfo ({ database, accessMode }) {
313301
const context = { database: database || DEFAULT_DB_NAME }
314302

packages/neo4j-driver-deno/lib/core/connection-provider.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ class ConnectionProvider {
110110
throw Error('Not implemented')
111111
}
112112

113-
ensureFreshRoutingTable (param?: { database?: string, accessMode?: string }): Promise<void> {
114-
throw Error('Not implemented')
115-
}
116-
117113
/**
118114
* This method verifies the connectivity of the database by trying to acquire a connection
119115
* for each server available in the cluster.

packages/neo4j-driver-deno/lib/core/driver.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,6 @@ class Driver {
868868
const sessionMode = Session._validateSessionMode(defaultAccessMode)
869869
const connectionProvider = this._getOrCreateConnectionProvider()
870870
const homeDatabase = this.homeDatabaseCache.get(impersonatedUser ?? auth?.principal ?? '')
871-
if (homeDatabase !== undefined && homeDatabase !== '') {
872-
void connectionProvider.ensureFreshRoutingTable({ database: homeDatabase })
873-
}
874871
const bookmarks = bookmarkOrBookmarks != null
875872
? new Bookmarks(bookmarkOrBookmarks)
876873
: Bookmarks.empty()
@@ -880,7 +877,8 @@ class Driver {
880877
database: database ?? '',
881878
connectionProvider,
882879
bookmarks,
883-
config: {...this._config,
880+
config: {
881+
...this._config,
884882
homeDatabase
885883
},
886884
reactive,

packages/neo4j-driver-deno/lib/core/internal/connection-holder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ConnectionHolder implements ConnectionHolderInterface {
175175
private async _createConnectionPromise (connectionProvider: ConnectionProvider, homeDatabase?: string): Promise<Connection & Releasable | null> {
176176
return await connectionProvider.acquireConnection({
177177
accessMode: this._mode,
178-
database: (this._database === "" && homeDatabase !== undefined) ? homeDatabase : this._database,
178+
database: (this._database === '' && homeDatabase !== undefined) ? homeDatabase : this._database,
179179
bookmarks: await this._getBookmarks(),
180180
impersonatedUser: this._impersonatedUser,
181181
onDatabaseNameResolved: this._onDatabaseNameResolved,

0 commit comments

Comments
 (0)