This repository was archived by the owner on Jul 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
cypher-shell/src/main/java/org/neo4j/shell/state Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -55,26 +55,20 @@ public void setActiveDatabase(String databaseName) throws CommandException
5555 }
5656 String previousDatabaseName = activeDatabaseNameAsSetByUser ;
5757 activeDatabaseNameAsSetByUser = databaseName ;
58- try
59- {
60- if ( isConnected () )
61- {
62- reconnect ( false );
58+ try {
59+ if (isConnected ()) {
60+ reconnect (true );
6361 }
6462 }
65- catch ( ClientException e )
66- {
67- if ( isInteractive )
68- {
63+ catch (ClientException e ) {
64+ if (isInteractive ) {
6965 // We want to try to connect to the previous database
7066 activeDatabaseNameAsSetByUser = previousDatabaseName ;
71- try
72- {
73- reconnect ( false );
67+ try {
68+ reconnect (true );
7469 }
75- catch ( ClientException e2 )
76- {
77- e .addSuppressed ( e2 );
70+ catch (ClientException e2 ) {
71+ e .addSuppressed (e2 );
7872 }
7973 }
8074 throw e ;
@@ -182,7 +176,7 @@ private void reconnect(boolean keepBookmark) {
182176 builder .withBookmarks (systemBookmark );
183177 }
184178
185- session = driver .session ( builder .build () );
179+ session = driver .session (builder .build ());
186180
187181 String query = activeDatabaseNameAsSetByUser .compareToIgnoreCase (SYSTEM_DB_NAME ) == 0 ? "SHOW DEFAULT DATABASE" : "RETURN 1" ;
188182
You can’t perform that action at this time.
0 commit comments