Created
February 25, 2012 17:20
-
-
Save spmallette/1909604 to your computer and use it in GitHub Desktop.
tx in tx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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