public String getURL() { return database.getURL(); }
protected ODatabaseDocumentTx(ODatabaseDocumentInternal ref, String baseUrl) { url = ref.getURL(); type = ref.getType(); this.baseUrl = baseUrl; dbName = ref.getName(); internal = ref; this.ownerProtection = true; }
/** * Reuses the underlying database avoiding to create and open it every time. * * @param iDatabase Underlying database object */ public OrientBaseGraph reuse(final ODatabaseDocumentInternal iDatabase) { ODatabaseRecordThreadLocal.instance().set(iDatabase); this.url = iDatabase.getURL(); database = iDatabase; makeActive(); return this; }
@ConsoleCommand(description = "Freeze database and flush on the disk", onlineHelp = "Console-Command-Freeze-Database") public void freezeDatabase( @ConsoleParameter(name = "storage-type", description = "Storage type of server database", optional = true) String storageType) throws IOException { checkForDatabase(); final String dbName = currentDatabase.getName(); if (currentDatabase.getURL().startsWith(OEngineRemote.NAME)) { if (storageType == null) storageType = "plocal"; new OServerAdmin(currentDatabase.getURL()).connect(currentDatabaseUserName, currentDatabaseUserPassword) .freezeDatabase(storageType); } else { // LOCAL CONNECTION currentDatabase.freeze(); } message("\n\nDatabase '" + dbName + "' was frozen successfully"); }
@ConsoleCommand(description = "Release database after freeze", onlineHelp = "Console-Command-Release-Db") public void releaseDatabase( @ConsoleParameter(name = "storage-type", description = "Storage type of server database", optional = true) String storageType) throws IOException { checkForDatabase(); final String dbName = currentDatabase.getName(); if (currentDatabase.getURL().startsWith(OEngineRemote.NAME)) { if (storageType == null) storageType = "plocal"; new OServerAdmin(currentDatabase.getURL()).connect(currentDatabaseUserName, currentDatabaseUserPassword) .releaseDatabase(storageType); } else { // LOCAL CONNECTION currentDatabase.release(); } message("\n\nDatabase '" + dbName + "' was released successfully"); }
if (!currentDatabase.getURL().startsWith("plocal")) { message("\n fix-bonsai can be run only on plocal connection \n"); return;
if (!currentDatabase.getURL().startsWith("plocal")) { message("\n fix-bonsai can be run only on plocal connection \n"); return;
public ODatabaseImport importDatabase() { boolean preValidation = database.isValidationEnabled(); try { listener.onMessage("\nStarted import of database '" + database.getURL() + "' from " + fileName + "...");
@ConsoleCommand(aliases = { "status" }, description = "Display information about the database", onlineHelp = "Console-Command-Info") public void info() { if (currentDatabaseName != null) { message("\nCurrent database: " + currentDatabaseName + " (url=" + currentDatabase.getURL() + ")"); currentDatabase.getMetadata().reload(); final OStorage stg = currentDatabase.getStorage(); if (stg instanceof OStorageRemote) { listServers(); } listProperties(); listClusters(null); listClasses(); listIndexes(); } }