Package com.tinkerpop.blueprints

Examples of com.tinkerpop.blueprints.TransactionalGraph.commit()


    public void testTx() {
        TransactionalGraph graph = (TransactionalGraph) graphTest.generateGraph();
        ((SparkseeGraph) graph).typeScope.set(true);
        this.stopWatch();

        graph.commit();

        graph.addVertex(null).setProperty("name", "sergio");
        graph.addVertex(null).setProperty("name", "marko");
        assertTrue(graph.getVertices("name", "sergio").iterator().next()
                .getProperty("name").equals("sergio"));
View Full Code Here


        graph.addVertex(null).setProperty("name", "sergio");
        graph.addVertex(null).setProperty("name", "marko");
        assertTrue(graph.getVertices("name", "sergio").iterator().next()
                .getProperty("name").equals("sergio"));
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);

        assertTrue(graph.getVertices("name", "sergio").iterator().next().getProperty("name").equals("sergio"));
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);
View Full Code Here

                .getProperty("name").equals("sergio"));
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);

        assertTrue(graph.getVertices("name", "sergio").iterator().next().getProperty("name").equals("sergio"));
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);

        graph.addVertex(null);
View Full Code Here

        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);

        assertTrue(graph.getVertices("name", "sergio").iterator().next().getProperty("name").equals("sergio"));
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);

        graph.addVertex(null);
        graph.shutdown();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);
View Full Code Here

    ExtensionResponse response = handlePost(graph, context, VERTEX);

    if (graph instanceof TransactionalGraph) {
      TransactionalGraph tgraph = (TransactionalGraph) graph;
      tgraph.commit();
    }

    return response;
  }
View Full Code Here

      edge = graph.addEdge(null, out, in, label);
      accumulateAttributes(edge, element);
      if (graph instanceof TransactionalGraph) {
        TransactionalGraph tgraph = (TransactionalGraph) graph;
        try {
          tgraph.commit();
          return;
        } catch (Exception e) {
          tgraph.rollback();
          logger.warn("Exception thrown while saving edge: " + e.toString());
          logger.warn("retry: " + retryCount);
View Full Code Here

        for (int i = 0; i < threads.length; i++) {
            //threads[i]=new Thread(new DoSomething(tx));
            threads[i].start();
        }
        for (int i = 0; i < threads.length; i++) threads[i].join();
        tx.commit();
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.