Skip to content

create_relationship causes batch to fail (returns nil) #40

Open
ryanfields opened this Issue Apr 24, 2012 · 2 comments

2 participants

@ryanfields

I'm unable to create relationships in a batch. The moment I add a :create_relationship call to a batch, @neo.batch returns nil and nothing is created in my graph.

The following fails:

[:create_unique_node, "person", "ssn", "000-00-0001", {:first_name=>"Jane", :last_name=>"Doe", :ssn=>"000-00-0001", :_type=>"Person", :created_at=>1335269478}],
[:add_node_to_index, "person_ssn", "ssn", "000-00-0001", "{0}"],
[:create_node, {:street1=>"94437 Kemmer Crossing", :street2=>"Apt. 333", :city=>"Abshireton", :state=>"AA", :zip=>"65820", :_type=>"Address", :created_at=>1335269478}],
[:create_relationship, "has", "{0}", "{2}", {}]

However, the nodes get created (without the relationship) if I just run:

[:create_unique_node, "person", "ssn", "000-00-0001", {:first_name=>"Jane", :last_name=>"Doe", :ssn=>"000-00-0001", :_type=>"Person", :created_at=>1335269478}],
[:add_node_to_index, "person_ssn", "ssn", "000-00-0001", "{0}"],
[:create_node, {:street1=>"94437 Kemmer Crossing", :street2=>"Apt. 333", :city=>"Abshireton", :state=>"AA", :zip=>"65820", :_type=>"Address", :created_at=>1335269478}]

I've tried [:create_relationship, "has", "{0}", "{2}"] instead with the same failing result. Since there is no error raised when my batch fails, I've been unable to track down exactly what is going wrong.

@maxdemarzi
Owner

This may be a Neo4j problem.

I tried it both ways on version 1.7 (create unique node first, or create regular node first) all fails.
Tried it on 1.8, creating a regular node first works, but then the relationship is pointing the wrong way. If I try reversing the numbers {2} {0} I get an error.

I think => https://github.com/neo4j/community/issues/302 is part of the problem.

@maxdemarzi
Owner

I went ahead and opened a new ticket. https://github.com/neo4j/community/issues/465
It seems to work the first time, and fail everytime afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.