0

I am connecting to neo4j the normal way and i can run queries no problem.
During testing, i wrote a query that should fail (due to uniqueness constraint), the query does fail as expected and i catch the exception.
The problem is when i try to execute the next query in the queue, it just hangs (longer than timeout).
I don't suppose that is normal behavior.

 try{
     $result = $neo->run ($query);
 }
 catch (Exception $e) {
          // handle it
 }

 // all good so far
 // now we attempt:

try{
    $result = $neo->run ($next_query);
 }
 catch (Exception $e) {
          // handle it
 }
// hangs longer than timeout

if i remove the failed query from the queue, everything completes

Albert S
  • 2,552
  • 1
  • 22
  • 28

1 Answers1

0

So it seems that the exception thrown by the php-client breaks the connection to neo4j.
If i modify the code to the following, it all works fine.

try{
     $result = $neo->run ($query);
 }
 catch (Exception $e) {
          // handle it
      connect_to_neo()
 }

 // all good so far

try{
    $result = $neo->run ($next_query);
 }
 catch (Exception $e) {
          // handle it
 }
 // all good, $next_query gets executed

I do not think that an exception that breaks the connection is desired behavior. Will raise the issue on github.

Albert S
  • 2,552
  • 1
  • 22
  • 28