You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tx = Neo4j.transaction(con);
for (counter, row) inzip(1:nrow(dataframe), eachrow(dataframe))
tx("MERGE (g:Type1 {name: '$(row[:text1])'}) MERGE (s:Type2 {name: '$(row[:text2])'}) ON CREATE SET s :MyLabel MERGE (s)-[syn:HAS_CONNECTION_TO]->(g);", submit=false);
endcommit(tx);
After approximately 147 rows he receives a 404, connection failed error. If he runs just the first 100 it works fine.
We're not sure if the transaction is just filling up, or timing out, or if there is another problem, perhaps a bug in the library and the way it uses the Cypher API.
@glesica
The way I currently handle it is to submit every n rows and do a Neo4j.commit every y rows.
For example, to add data contained in a DataFrame x to the database I do the following:
tx = Neo4j.transaction(con);
for row in DataFrames.eachrow(x)
trytx(query,
"field1"=> row[:column1],
"field2"=> row[:column2];
submit = row.row %3000==0
);
if row.row %20000==0println("\t->commit 20000 records...[$(row.row)]");
res = Neo4j.commit(tx);
tx = Neo4j.transaction(con);
endcatch y
println(y.msg);
error("Error at row: + $(row.row)");
endend
res = Neo4j.commit(tx)
I know it is just a workaround and a bit of overhead but once wrapped into a function, it's straightforward.
A user has observed the following:
After approximately 147 rows he receives a 404, connection failed error. If he runs just the first 100 it works fine.
We're not sure if the transaction is just filling up, or timing out, or if there is another problem, perhaps a bug in the library and the way it uses the Cypher API.
@lyonwj
The text was updated successfully, but these errors were encountered: