Reputation: 11
Using Neo4j2.0 embedded in Java applications, How can I do both Bulk Inserts (10M nodes and 13M relations) every 5 mins in one Process and Read operations on same database in other Process ? While doing Inserts Database is locked and so unable to open connection for Read operations.
For Inserts using BatchInserter inserter = BatchInserters.inserter(...*
And For Read using
*GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH );*
Please suggest if there is any alternative or if it is possible to disable Locking.
Thanks.
Upvotes: 1
Views: 47
Reputation: 41706
You can't out of the box.
Something you can do is to do the inserts with the batch-inserter reading from a queue.
And whenever you need a new snapshot of that imported data you shut down the batch-inserter, copy the database over to the transactional application and start it from that snapshot.
Otherwise, just use the normal transactional API for both reading and writing.
As long as you batch-writes, e.g. 50k nodes/rels per batch, you should should be still fine, doing both from the same process.
Upvotes: 1