docs: public static Database getDatabase(String type, String path,
                                         HsqlProperties props) {
  
          // If the (type, path) pair does not correspond to a registered
          // instance, then getDatabaseObject() returns a newly constructed
          // and registered Database instance.
          // The database state will be DATABASE_SHUTDOWN,
          // which means that the switch below will attempt to
          // open the database instance.
          Database db = getDatabaseObject(type, path, props);
  
          synchronized (db) {
              switch (db.getState()) {
  
                  case Database.DATABASE_ONLINE :
                      break;
  
                  case Database.DATABASE_SHUTDOWN :
  
                      // if the database was shutdown while this attempt
                      // was waiting, add the database back to the registry
                      if (lookupDatabaseObject(type, path) == null) {
                          addDatabaseObject(type, path, db);
                      }
  
                      db.open();
                      break;
  
                  // This state will currently not be reached as Database.Close() is
                  // called while a lock is held on the database.
                  // If we remove the lock from this method and a database is
                  // being shutdown by a thread and in the meantime another thread
                  // attempts to connect to the db. The threads could belong to
                  // different server instances or be in-process.
                  case Database.DATABASE_CLOSING :
  
                  // this case will not be reached as the state is set and
                  // cleared within the db.open() call above, which is called
                  // from this synchronized block
                  // it is here simply as a placeholder for future development
                  case Database.DATABASE_OPENING :
                      throw Error.error(ErrorCode.LOCK_FILE_ACQUISITION_FAILURE,
                                        ErrorCode.M_DatabaseManager_getDatabase);
              }
          }
  
          return db;
      }