Skip to content

Commit

Permalink
Nested manual transactions should raise an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrick Wiebe committed Dec 13, 2010
1 parent 4cc8ba3 commit ab900b2
Showing 1 changed file with 10 additions and 15 deletions.
Expand Up @@ -392,23 +392,18 @@ public void testAutomaticIndexExceptionRollback() {
}

public void testNestedManualTransactions() {
if (graphTest.isPersistent) {
TransactionalGraph graph = (TransactionalGraph) graphTest.getGraphInstance();
Object v1id = graph.addVertex(null).getId();
graph.setTransactionMode(TransactionalGraph.Mode.MANUAL);
graph.startTransaction();
TransactionalGraph graph = (TransactionalGraph) graphTest.getGraphInstance();
graph.setTransactionMode(TransactionalGraph.Mode.MANUAL);
graph.startTransaction();
RuntimeException ex = null;
try {
graph.startTransaction();
Object v2id = graph.addVertex(null).getId();
graph.stopTransaction(TransactionalGraph.Conclusion.SUCCESS);
Object v3id = graph.addVertex(null).getId();
graph.stopTransaction(TransactionalGraph.Conclusion.SUCCESS);
graph.shutdown();
graph = (TransactionalGraph) graphTest.getGraphInstance();
assertNotNull(graph.getVertex(v1id));
assertNotNull(graph.getVertex(v2id));
assertNotNull(graph.getVertex(v3id));
graph.shutdown();
} catch (RuntimeException e) {
ex = e;
}
assertNotNull(ex);
assertEquals("Nested transactions are not supported", ex.getMessage());
graph.shutdown();
}

}

0 comments on commit ab900b2

Please sign in to comment.