@Override public void commit() { db.commit(); retries = 0; }
public void commit() throws OdaException { db.commit(); }
@Override public void commit() { db.commit(); }
public void commit() { final OrientGraphContext context = getContext(false); if (context == null) return; context.rawGraph.commit(); }
private void commitBatch(final ODatabaseDocumentTx db, final List<BlobRef> deletedBlobs, final Set<String> deletedBlobStores) { checkNotNull(db); checkNotNull(deletedBlobs); checkNotNull(deletedBlobStores); db.commit(); for (BlobRef blobRef : deletedBlobs) { deleteBlob(deletedBlobStores, blobRef); } deletedBlobs.clear(); }
@Override @Transitions(from = ACTIVE, to = OPEN, silent = true) public void commit() { db.commit(); // this must happen _before_ we commit any blob changes blobTx.commit(); retries = 0; }
private void removeContext() { final OrientGraphContext context = getContext(false); if (context != null) { for (Index<? extends Element> idx : context.manualIndices.values()) ((OrientIndex<?>) idx).close(); context.manualIndices.clear(); if (!context.rawGraph.isClosed()) { context.rawGraph.commit(); context.rawGraph.close(); } synchronized (contexts) { contexts.remove(context); } threadContext.set(null); } }
@Override public void end() { if (dbType == DB_TYPE.DOCUMENT) pipeline.getDocumentDatabase().commit(); else pipeline.getGraphDatabase().commit(); }
private boolean populateCaseInsensitiveNameFieldBatch(final ODatabaseDocumentTx db) { log.trace("Processing batch of {} component records...", BATCH_SIZE); db.begin(); List<ODocument> components = db.query(SELECT_COMPONENT_BATCH); if (components.isEmpty()) { return false; } for (ODocument component : components) { String name = component.field(P_NAME, String.class); component.field(P_CI_NAME, name.toLowerCase(Locale.ENGLISH)); component.save(); } db.commit(); return true; }
@Override public void init() { try (ODatabaseDocumentTx db = docDb()) { OSchema schema = db.getMetadata().getSchema(); if (!schema.existsClass(GCP_CONFIG)) { OClass newClass = schema.createClass(GCP_CONFIG); newClass.createProperty("hg", OType.STRING); newClass.createProperty("map", OType.EMBEDDEDMAP); newClass.createIndex("hg.unq", OClass.INDEX_TYPE.UNIQUE, "hg"); db.commit(true); db.command(new OCommandSQL("INSERT INTO " + GCP_CONFIG + " SET hg=\"" + hostGroup + "\", map={}")).execute(); } fetchFromDb(db); executor.scheduleAtFixedRate(() -> { LOG.info("Trying to reload configuration from main DB."); putLock.writeLock().lock(); try { if (!isClosed) { try (ODatabaseDocumentTx _db = docDb()) { fetchFromDb(_db); } } } finally { putLock.writeLock().unlock(); } }, readLong(ConfigProperty.POLL_INTERVAL), readLong(ConfigProperty.POLL_INTERVAL), TimeUnit.MILLISECONDS); } }
if (dbType == DB_TYPE.DOCUMENT) { final ODatabaseDocumentTx documentDatabase = pipeline.getDocumentDatabase(); documentDatabase.commit(); beginTransaction(documentDatabase); } else {