Web アプリケーションで Neo4j 2.2.8 と Spring Data を使用しています。次のように、xml を使用してデータベースを構成しています。
<neo4j:config storeDirectory="S:\Neo4j\mybase" />
しかし、バッチ インサータを使用して、.txt ファイルをソースとする 100 万を超えるノードを追加しようとしています。ファイルを読み取ってオブジェクトのリストを設定した後、バッチ処理するコードは次のようになります。
public void batchInserter(List<Objects> objects) {
BatchInserter inserter = null;
try {
inserter = BatchInserters.inserter("S:\\Neo4j\\mybase");
Label movimentosLabel = DynamicLabel.label("Movimentos");
inserter.createDeferredSchemaIndex(movimentosLabel).on("documento").create();
for (Objects objs : objects{
Map<String, Object> properties = new HashMap<>();
properties.put("documento", objs.getDocumento());
long movimento = inserter.createNode(properties, movimentosLabel);
DynamicRelationshipType relacionamento = DynamicRelationshipType.withName("CONTA_MOVIMENTO");
inserter.createRelationship(movimento, objs.getConta().getId(), relacionamento, null);
}
} finally {
if (inserter != null) {
inserter.shutdown();
}
}
}
「インサーター」のxmlで構成されたデータベースのパスを取得することは可能ですか? 上記の構成では、Neo4j が複数の接続に関するエラーを表示するためです。複数接続のこのエラーを解決するプロパティを設定できますか? 誰かがこの問題を抱えていて、それを解決する方法を知っていますか? アイデアは大歓迎です。
みんなありがとう!