-
Notifications
You must be signed in to change notification settings - Fork 137
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
Batch Branch: 400 Bad Request #4
Comments
Hey Peter, I haven't had time to investigate yet, but I suspect it's because the request data is not getting JSON encoded correctly. Can you var_dump the output of Transport::encodeData(); in the Transport::makeRequest() method, and post it here? File is lib/Everyman/Neo4j/Transport.php Thanks! -- Josh |
Hey Josh, Thanks for the quick reply, here's what is being encoded (
And this is what is being outputted by
Cheers,
|
Hey Peter, The problem is that the outer "wrapper" of the data should be encoded as an array, not an object. In other words, the data needs to end up looking like this:
A potential fix might be to have Transport::encodeData() look to see if the outer array is numerically indexed only and, if so, not cast it to an object before encoding. I will take a look at it soon, or you can take a stab at it if you want. Thanks for the find! -- Josh |
Hey Peter, Could you pull the latest batch branch, which includes commit 87499ce. It should fix the issue. Please let me know if there is still a problem. Thanks. -- Josh |
Hey Josh, your fix worked, thanks :) I'm opening a separate ticket however, as batch inserts are incredibly slow compared to sequential inserts. Example script / benchmarks in #5. |
Hi Josh,
I'm currently trying your batch branch and have encountered an error in committing operations, the following example code should work:
The issue lies in that
$result
will always return false. After some debugging I discovered that Java is returning a400 Bad Request
with the following message:java.util.LinkedHashMap cannot be cast to java.util.List
inTransport->makeRequest()
. The full stacktrace is available here: https://gist.github.com/25fd7f7aef3fdb77e32aI'm currently running Neo4j 1.4.1 (upgraded from 1.4, just in case that was the problem).
Any ideas?
Cheers,
The text was updated successfully, but these errors were encountered: