@Override public void reload() { checkIfActive(); if (this.isClosed()) throw new ODatabaseException("Cannot reload a closed db"); metadata.reload(); getStorage().reload(); }
private void replaceStorage(ODatabaseDocumentTx db, final OStorage storage) { db.replaceStorage(storage); if (!db.isClosed()) { try { // reload metadata for active connections if old schema is gone if (db.getMetadata().getSchema().countClasses() == 0) { log.debug("Reloading metadata for {} as storage has changed", db.getName()); db.activateOnCurrentThread(); db.getMetadata().reload(); } } catch (Exception e) { log.warn("Problem reloading metadata for {}", db.getName(), e); } } }