graphaware / neo4j-bolt-php

PHP Driver for Neo4j's Binary Protocol : Bolt
MIT License
42 stars 38 forks source link

Infinite loop on session #15

Closed bitgandtter closed 7 years ago

bitgandtter commented 7 years ago

Im having an infinite loop on session recv function that i track to lines 170 and 171 of Session.php file

the queries im running are:

$stack = $this->neo4jClient->stack();
$stack->push("CREATE CONSTRAINT ON (person:Person) ASSERT person.mongoID IS UNIQUE");
$stack->push(
                "CREATE (person:Person) SET person += {info}",
                array('info' => array('mongoID' => (string)$person->getId()))
);
$this->neo4jClient->runStack($stack);

Where the person already exist on database

ikwattro commented 7 years ago

can you specify the neo4j version you are using ?

bitgandtter commented 7 years ago

version 3.1, i dont think related but im using it with the official docker image

ikwattro commented 7 years ago

@bitgandtter can you try with last release 1.8.1 ? Thanks

bitgandtter commented 7 years ago

@ikwattro now it throws this exception when trying to collect statistics

Argument 1 passed to GraphAware\Common\Result\CombinedStatistics::mergeStats() must implement interface GraphAware\Common\Result\StatementStatisticsInterface, null given

bitgandtter commented 7 years ago

I track the issue to the point that because the stack is running a query that does not provide updateStatistics it breaks.

$stack->push("CREATE CONSTRAINT ON (person:Person) ASSERT person.mongoID IS UNIQUE");

We have two options here, or update the updateStatistics function of the ResultCollection to handle this or to not include on the collection results that does not has updateStatistics on the run function of Pipeline class

ikwattro commented 7 years ago

yeah, fixed in common

composer update graphaware/neo4j-common

thx

bitgandtter commented 7 years ago

Great it works now, thanks