Skip to content

Instantly share code, notes, and snippets.

@spmallette
Created February 25, 2012 17:20
Show Gist options
  • Save spmallette/1909604 to your computer and use it in GitHub Desktop.
Save spmallette/1909604 to your computer and use it in GitHub Desktop.
tx in tx
public void testTransactionInTransaction() {
TransactionalGraph graph = (TransactionalGraph) graphTest.getGraphInstance();
for (int i = 0; i < 100; i++) {
final Vertex v1 = graph.addVertex(null);
final Vertex v2 = graph.addVertex(null);
graph.setMaxBufferSize(0);
graph.startTransaction();
final Vertex v1ForEdge = graph.getVertex(v1.getId().toString());
final Vertex v2ForEdge = graph.getVertex(v2.getId().toString());
graph.addEdge(null, v1ForEdge, v2ForEdge, "junk");
graph.stopTransaction(TransactionalGraph.Conclusion.SUCCESS);
graph.setMaxBufferSize(1);
}
graph.shutdown();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment