lib/neo4j/migration.rb in neo4j-3.0.0 vs lib/neo4j/migration.rb in neo4j-3.0.1

- old
+ new

@@ -77,17 +77,20 @@ end end def id_batch_set(label, property, new_ids, to_set) Benchmark.realtime do - Neo4j::Transaction.run do + begin + tx = Neo4j::Transaction.new Neo4j::Session.query("MATCH (n:`#{label}`) WHERE NOT has(n.#{property}) with COLLECT(n) as nodes, #{new_ids} as ids FOREACH(i in range(0,#{to_set - 1})| FOREACH(node in [nodes[i]]| SET node.#{property} = ids[i])) RETURN distinct(true) LIMIT #{to_set}") + ensure + tx.close end end end def default_max_per_batch