public void commit() { if (this.baseGraph instanceof TransactionalGraph) { ((TransactionalGraph) baseGraph).commit(); } }
/** * Signals the end of the RDF data. This method is called when all data has * been reported. * * @throws org.openrdf.rio.RDFHandlerException If the RDF handler has encountered an unrecoverable error. */ @Override public void endRDF() throws RDFHandlerException { if(graph instanceof TransactionalGraph) { ((TransactionalGraph)graph).commit(); } }
@Override public void doCommitTransaction(Graph currentTransaction) { if (currentTransaction instanceof TransactionalGraph) { ((TransactionalGraph) currentTransaction).commit(); } }
/** * Should only be invoked after loading is complete. Committing the transaction before will cause the loading to fail. */ @Override public void commit() { currentEdge = null; currentEdgeCached = null; remainingBufferSize = 0; baseGraph.commit(); }
/** * Signals the end of the RDF data. This method is called when all data has * been reported. * * @throws org.openrdf.rio.RDFHandlerException If the RDF handler has encountered an unrecoverable error. */ @Override public void endRDF() throws RDFHandlerException { if(graph instanceof TransactionalGraph) { ((TransactionalGraph)graph).commit(); } }
@Override public void commit() { if (baseGraph instanceof TransactionalGraph) { final TransactionalGraph transactionalGraph = (TransactionalGraph) baseGraph; transactionalGraph.commit(); } }
/** * Commit the transaction. */ public void commit() { if (graph != null) { graph.commit(); } comitted = true; }
@Override public final void commit() { if (txBaseGraph != null) { LOGGER.finest("committing transactional graph"); txBaseGraph.commit(); } else { LOGGER.finest("not a transactional graph; skip commit"); } }
private void nextElement() { currentEdge = null; currentEdgeCached = null; if (remainingBufferSize <= 0) { baseGraph.commit(); cache.newTransaction(); remainingBufferSize = bufferSize; } remainingBufferSize--; }
@Override public void shutdown() { baseGraph.commit(); baseGraph.shutdown(); currentEdge = null; currentEdgeCached = null; }
@Override public void commit() { getBaseGraph().commit(); }
@Override public void commit() { getBaseGraph().commit(); }
public T execute(final TransactionalGraph graph, final TransactionWork<T> work) { T returnValue; try { returnValue = work.execute(graph); graph.commit(); } catch (Exception e) { graph.rollback(); throw new RuntimeException(e); } return returnValue; } }
public T execute(final TransactionalGraph graph, final TransactionWork<T> work) { T returnValue = null; try { returnValue = work.execute(graph); graph.commit(); } catch (Exception e) { graph.rollback(); } return returnValue; } }
public void convertViaSchema(String schemaVersionClassName, String label) { for (Vertex schemaVertex : getGraph().getVertices("@class", schemaVersionClassName)) { Schema schema = buildSchemaFromVertex(schemaVertex, schemaVersionClassName); if (!schema.fieldMap.isEmpty()) { log.info("Update vertices for {}", schema); updateVerticesForSchema(schemaVertex, schema.fieldMap, label); log.debug("Commit the changes for the remaining vertices of schema {} to database...", schema); getGraph().commit(); } } }
@Override public void applyInTx() { long count = 0; Iterable<Vertex> it = getGraph().getVertices("@class", "NodeGraphFieldContainerImpl"); for (Vertex nodeContainer : it) { migrateContainer(nodeContainer); count++; if (count % 1000 == 0) { log.info("Migrated {" + count + "} contents"); getGraph().commit(); } } }
@Override public void markAsComplete() { TransactionalGraph graph = db.rawTx(); setGraph(graph); changelogRoot().add(this); setGraph(null); graph.commit(); graph.shutdown(); }
public void updateVerticesForSchema(Vertex schemaVertex, Map<String, JsonObject> fieldMap, String label) { long count = 0; for (Vertex vertex : schemaVertex.getVertices(Direction.IN, label)) { count++; updateFields(vertex, fieldMap); updateLists(vertex, fieldMap); if (count % 10000 == 0) { log.debug("Commit the changes for the last 10.000 vertices to database..."); getGraph().commit(); log.info("Updated vertices {}", count); } } }
public void testVertexReattachment() { TransactionalGraph graph = (TransactionalGraph) graphTest.generateGraph(); Vertex a = graph.addVertex(null); Vertex b = graph.addVertex(null); Edge e = graph.addEdge(null, a, b, "friend"); graph.commit(); a = graph.getVertex(a); Assert.assertNotNull(a); Assert.assertEquals(1, BaseTest.count(a.getVertices(Direction.OUT))); graph.shutdown(); }
public void testVertexReattachment() { TransactionalGraph graph = (TransactionalGraph) graphTest.generateGraph(); Vertex a = graph.addVertex(null); Vertex b = graph.addVertex(null); Edge e = graph.addEdge(null, a, b, "friend"); graph.commit(); a = graph.getVertex(a); Assert.assertNotNull(a); Assert.assertEquals(1, BaseTest.count(a.getVertices(Direction.OUT))); graph.shutdown(); }