[Neo4j] Batch Inserter, Node Property error

Christopher Schmidt fakod666 at googlemail.com
Mon Oct 24 06:38:38 CEST 2011


Hi all,

I am writing a Scala wrapper for the batch insertion interfaces. While doing
so, I have the problem that properties are not written to DB.
I wrote a little test case for Java, same error. The code below prints out:

2 has property keys [2, 1]
2 has property keys []

Am I doing something wrong?

Regards Christopher

PS: Neo4j version 1.5-SNAPSHOT



public class JavaMain {
    public static void main(String[] args) {

        String path = "/tmp/temp-neo-batch-test";

        BatchInserter inserter = new BatchInserterImpl(path);
        BatchInserterIndexProvider provider = new
LuceneBatchInserterIndexProvider(inserter);
        String name = "users";
        BatchInserterIndex index = provider.nodeIndex(name,
LuceneIndexImplementation.EXACT_CONFIG);

        GraphDatabaseService gds = inserter.getGraphDbService();

        Node myNode = gds.createNode();
        long id = myNode.getId();

        myNode.setProperty("1", "one");
        myNode.setProperty("2", "two");

        index.flush();
        System.out.println(myNode.getId() + " has property keys " +
myNode.getPropertyKeys());

        provider.shutdown();
        inserter.shutdown();

        GraphDatabaseService db = new EmbeddedGraphDatabase(path);
        Node node1 = db.getNodeById(id);
        System.out.println(node1.getId() + " has property keys " +
node1.getPropertyKeys());
        db.shutdown();
    }
}

-- 
Christopher
twitter: @fakod
blog: http://blog.fakod.eu


More information about the User mailing list