public void close() { database.declareIntent(null); if (writer == null) return; try { writer.endObject(); writer.close(); writer = null; } catch (IOException e) { OLogManager.instance().error(this, "Error on exporting database '%s' to: %s", e, database.getName(), fileName); throw new ODatabaseExportException("Error on exporting database '" + database.getName() + "' to: " + fileName, e); } if (tempFileName != null) // may be null if writing to an output stream w/o file try { OFileUtils.atomicMoveWithFallback(Paths.get(tempFileName), Paths.get(fileName), this); } catch (IOException e) { OLogManager.instance().error(this, "Error on exporting database '%s' to: %s", e, database.getName(), fileName); throw new ODatabaseExportException("Error on exporting database '" + database.getName() + "' to: " + fileName, e); } }
writer.close(); } catch (IOException e1) { throw new ODatabaseExportException("Error on importing database '" + database.getName() + "' from file: " + fileName, e1); throw new ODatabaseExportException("Error on importing database '" + database.getName() + "' from file: " + fileName, e); } finally { database.setValidationEnabled(preValidation);
public ODatabaseExport exportDatabase() { try { listener.onMessage("\nStarted export of database '" + database.getName() + "' to " + fileName + "..."); long time = System.currentTimeMillis(); if (includeInfo) exportInfo(); if (includeClusterDefinitions) exportClusters(); if (includeSchema) exportSchema(); if (includeRecords) exportRecords(); if (includeIndexDefinitions) exportIndexDefinitions(); if (includeManualIndexes) exportManualIndexes(); listener.onMessage("\n\nDatabase export completed in " + (System.currentTimeMillis() - time) + "ms"); writer.flush(); } catch (Exception e) { OLogManager.instance().error(this, "Error on exporting database '%s' to: %s", e, database.getName(), fileName); throw new ODatabaseExportException("Error on exporting database '" + database.getName() + "' to: " + fileName, e); } finally { close(); } return this; }
OLogManager.instance() .error(this, "Error on comparing database '%s' against '%s'", e, databaseOne.getName(), databaseTwo.getName()); throw new ODatabaseExportException( "Error on comparing database '" + databaseOne.getName() + "' against '" + databaseTwo.getName() + "'", e); } finally {