Package com.tinkerpop.blueprints

Examples of com.tinkerpop.blueprints.TransactionalGraph


    /**
     * Stops a transaction with failure if the graph is transactional.  If the graph is not transactional,
     * the method does nothing.
     */
    public void tryRollback() {
        final TransactionalGraph transactionalGraph = tryGetTransactionalGraph();
        if (transactionalGraph != null) {
            // will leave this as stopTransaction until we completely remove it from blueprints so as to get as
            // much backward compatibility as we can
            //transactionalGraph.rollback();
            transactionalGraph.stopTransaction(TransactionalGraph.Conclusion.FAILURE);
        }
    }
View Full Code Here


    @RexsterContext Graph graph) {

    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);
          /* need to work out the Exceptions to handle?! */
          prevException = e;
        }
View Full Code Here

        g.createKeyIndex("name", Vertex.class);
        Vertex juno = g.addVertex(null);
        juno.setProperty("name", "juno");
        juno = g.getVertices("name", "juno").iterator().next();

        TransactionalGraph tx = g.newTransaction();
        Thread[] threads = new Thread[10];
        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

Related Classes of com.tinkerpop.blueprints.TransactionalGraph

Copyright © 2018 www.massapicom. 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.