Package org.neo4j.kernel

Examples of org.neo4j.kernel.AbstractGraphDatabase


    if (lastNode != null) {
      lastNode.delete();
      count++;
    }
    if (count >= commitInterval) {
      AbstractGraphDatabase graphDb = (AbstractGraphDatabase) bTree
          .getGraphDb();
      try {
        Transaction tx = graphDb.getDependencyResolver().resolveDependency(TransactionManager.class).getTransaction();
        if (tx != null) {
          tx.commit();
        }
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
      graphDb.beginTx();
      count = 0;
    }
    return count;
  }
View Full Code Here


            return Response.status(Status.INTERNAL_SERVER_ERROR).entity(JsonHelper.createJsonFrom(e.getMessage())).build();
        }
    }

    private Map<String, Object> cleanDbDirectory(Database database) throws Throwable {
        AbstractGraphDatabase graph = database.graph;
        String storeDir = graph.getStoreDir();
        if (storeDir == null) {
            storeDir = config.getString(DATABASE_LOCATION_PROPERTY_KEY);
        }
        graph.shutdown();
        Map<String, Object> result = removeDirectory(storeDir);

        // TODO wtf?
        // database.graph = new EmbeddedGraphDatabase(storeDir, graph.getKernelData().getConfigParams());
        database.start();
View Full Code Here

    @Ignore
    @Graph("I know you")
    @TestData.Title( "Get service root" )
    public void assert200OkFromGet() throws Exception
    {
        AbstractGraphDatabase db = (AbstractGraphDatabase)graphdb();
        Transaction tx = db.beginTx();
        db.getConfig().getGraphDbModule().setReferenceNodeId( data.get().get("I").getId() );
        tx.success();
        tx.finish();
        String body = gen.get().expectedStatus( 200 ).get( getDataUri() ).entity();
        Map<String, Object> map = JsonHelper.jsonToMap( body );
        assertEquals( getDataUri() + "node", map.get( "node" ) );
View Full Code Here

      lastNode.delete();
      count++;
    }
    if ( count >= commitInterval )
    {
        AbstractGraphDatabase graphDb = (AbstractGraphDatabase) bTree.getGraphDb();
            try
            {
                Transaction tx = graphDb.getDependencyResolver().resolveDependency(TransactionManager.class).getTransaction();
                if ( tx != null )
                {
                    tx.commit();
                }
            }
            catch ( Exception e )
            {
                throw new RuntimeException( e );
            }
            graphDb.beginTx();
      count = 0;
    }
    return count;
  }
View Full Code Here

      final Configuration config) {
    // prepare neo4j graph configuration
    final Map<String, String> graphConfig = loadDatabaseConfig(config);

    // load database from path specified
    AbstractGraphDatabase database;
    if (config.getReadOnly()) {
      database = new EmbeddedReadOnlyGraphDatabase(
          config.getDatabasePath(), graphConfig);
    } else {
      database = new EmbeddedGraphDatabase(config.getDatabasePath(),
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.AbstractGraphDatabase

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.