Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning hashes from Cypher within transactions causes errors #211

Closed
subvertallchris opened this issue Jun 8, 2015 · 1 comment
Closed
Assignees

Comments

@subvertallchris
Copy link
Contributor

Since mapped_rest_data is a hash, it treats it like Cypher object and tries to add an id, pull apart its rows, etc,...

Failure/Error: post api, data_hash, session_hash
     NoMethodError:
       undefined method `split' for nil:NilClass
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:152:in `add_transaction_entity_id'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:90:in `hash_value_as_object'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:79:in `map_row_value'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:71:in `block (2 levels) in row_pair_in_struct'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:70:in `each_pair'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:70:in `block in row_pair_in_struct'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:69:in `tap'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:69:in `row_pair_in_struct'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:62:in `block (2 levels) in to_node_enumeration'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:41:in `block in each'

Fixing that results in...

Failure/Error: post api, data_hash, session_hash
     NoMethodError:
       undefined method `[]' for nil:NilClass
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:133:in `first_data'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_session.rb:179:in `_query_or_fail'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_node.rb:98:in `labels'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-72320a3b817e/lib/neo4j/active_node/node_wrapper.rb:26:in `load_classes_from_labels'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-72320a3b817e/lib/neo4j/active_node/node_wrapper.rb:17:in `class_to_wrap'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-72320a3b817e/lib/neo4j/active_node/node_wrapper.rb:8:in `wrapper'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:99:in `hash_value_as_object'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:79:in `map_row_value'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:71:in `block (2 levels) in row_pair_in_struct'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:70:in `each_pair'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:70:in `block in row_pair_in_struct'
     # /Users/cgrigg/.rvm/gems/ruby-2.2.2/bundler/gems/neo4j-core-64035162aaef/lib/neo4j-server/cypher_response.rb:69:in `tap'

I'll take care of it but want to log it in the meantime.

@subvertallchris
Copy link
Contributor Author

Interestingly enough, I found that embedded didn't support returning hashes from Cypher at all!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants