Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.Transaction.success()


            RelTypes.MAP_ENTRY, Direction.OUTGOING ) )
          {
            Node entryNode = rel.getEndNode();
            if ( entryNode.getProperty( MAP_KEY ).equals( key ) )
            {
              tx.success();
              return (V) entryNode.getProperty( MAP_VALUE );
            }
          }
        }
      }
View Full Code Here


              return (V) entryNode.getProperty( MAP_VALUE );
            }
          }
        }
      }
      tx.success();
      return null;
    }
    finally
    {
      tx.finish();
View Full Code Here

        n2.setProperty("time", 123);
        index.add(n2, "timestamp", 123L);
        Node n3 = db.createNode();
        n3.setProperty("time", 124);
        index.add(n3, "timestamp", 124L);
        tx.success();
        tx.finish();

        tx = db.beginTx();
        GraphvizWriter writer = new GraphvizWriter();
        writer.emit(System.out, Walker.fullGraph(db));
View Full Code Here

        assertEquals(3, hits.size());

        ExecutionEngine engine = new ExecutionEngine(db);
        ExecutionResult result = engine.execute("start n=node:timeline1('[100 TO 200]') return n");
        System.out.println(result.toString());
        tx.success();
        tx.finish();
    }

}
View Full Code Here

                            // and complete its write process
                            assertFalse( sync.signalAndWait( States.WRITE, States.READ, 1, TimeUnit.SECONDS ) );
                        }
                    }

                    tx.success();
                    return true;
                }
                finally
                {
                    tx.finish();
View Full Code Here

        Map<String, Object> result = new HashMap<String, Object>();
        Transaction tx = graph.beginTx();
        try {
            clearIndex(result);
            removeNodes(result, maxNodesToDelete);
            tx.success();
        } finally {
            tx.finish();
        }
        return result;
    }
View Full Code Here

                final int to = (from + 1 + random.nextInt(max - 1)) % max;
                final Relationship relationship = nodes[from].createRelationshipTo(nodes[to], DynamicRelationshipType.withName("TEST_" + i));
                final Index<Relationship> index = indexManager.forRelationships("rel_index_" + String.valueOf(i % 5));
                index.add(relationship, "ID", i);
            }
            tx.success();
        } finally {
            tx.finish();
        }
    }
}
View Full Code Here

                GlobalGraphOperations graphOperations = GlobalGraphOperations.at(rawGraphDB);
                if (this.vertexIndexKeys.size() > 0)
                    populateKeyIndices(rawGraphDB, rawGraphDB.index().getNodeAutoIndexer(), graphOperations.getAllNodes(), Vertex.class);
                if (this.edgeIndexKeys.size() > 0)
                    populateKeyIndices(rawGraphDB, rawGraphDB.index().getRelationshipAutoIndexer(), graphOperations.getAllRelationships(), Edge.class);
                tx.success();
            } finally {
                tx.close();
            }
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
View Full Code Here

                if (!pc.hasProperty(property)) continue;
                pc.setProperty(property, pc.getProperty(property));
                count++;
                if (count >= 10000) {
                    count = 0;
                    tx.success();
                    tx.finish();
                    tx = rawGraphDB.beginTx();
                }
            }
        }
View Full Code Here

                    tx.finish();
                    tx = rawGraphDB.beginTx();
                }
            }
        }
        tx.success();
        tx.finish();
    }

    public String toString() {
        return StringFactory.graphString(this, this.rawGraph.toString());
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.