-
Notifications
You must be signed in to change notification settings - Fork 7
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
Driver agent may discard statements before they have executed #28
Comments
A simple way to fix this issue is to add a call to try {
$self->{_last_result} = $self->session->run($qry, $params);
+ $self->{_last_result}->detach;
}; try {
$self->{_last_result} = $tx->run($qry, $params);
+ $self->{_last_result}->detach;
}; I think this particular issue is probably evidence enough that the |
Actually, a call to I should probably add a better explanation of these side-effects to my documentation… |
It's necessary to call a method on the result within the try block. Any method will do; has_next() is one of the cheapest ones to call. Resolves #28.
The Neo4j driver API doesn’t guarantee that the server has completed executing a statement by the time the
run()
method returns. If you require a statement to have executed by a certain point, for example to check for errors, you need to use the result in some form. For the Perl driver, this is documented at Neo4j::Driver::Transaction.REST::Neo4p::Agent::Neo4j::Driver currently doesn’t do that in
run_in_session()
orrun_in_transaction()
:Statement execution might not even have begun on the server by the time
maybe_throw_neo4p_error()
is called. This may mask error reporting in certain cases.When used with HTTP JSON, this is not an issue, because the result is always detached immediately. This is different for Bolt and Jolt.
When running the test suite on Bolt, the following test in
050_v2_schema.t
fails because of this:The text was updated successfully, but these errors were encountered: