Neo4jPHP Transaction Error

190 Views Asked by At

I'm using the latest version of jadell's Neo4JPHP library and Neo4j version 2. When I try to commit 2 different cypher queries, it gives me an InvalidFormat error. The code is:

    $transaction = $this->client->beginTransaction();
    $queryA = new Everyman\Neo4j\Cypher\Query($this->client, "start n=node(485183) return id(n) as neoid, n.mongoid as mongoid");
    $queryB = new Everyman\Neo4j\Cypher\Query($this->client, "start n=node(485182) return id(n) as neoid, n.mongoid as mongoid");
    try{
        $results = $transaction->addStatements(array($queryA, $queryB), true);
    }
    catch( Exception $e){
        echo "<pre>";
        print_r( $e->getMessage());
        die;
    }

    return $results;

It gives an exception and prints this:

Error in transaction [200]:
Headers: Array
(
    [Content-Encoding] =>  UTF-8
    [Content-Type] =>  application/json
    [Access-Control-Allow-Origin] =>  *
    [Transfer-Encoding] =>  chunked
    [Server] =>  Jetty(9.0.5.v20130815)
)
Body: Array
(
    [results] => Array
        (
        )

    [errors] => Array
        (
            [0] => Array
                (
                    [code] => Neo.ClientError.Request.InvalidFormat
                    [message] => Unable to deserialize request: Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token
 at [Source: org.eclipse.jetty.server.HttpConnection$Input@62427798{HttpChannelOverHttp@79b9ce8d{r=2,a=DISPATCHED,uri=/db/data/transaction/commit},HttpConnection@15a7c96a{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=END,270 of 270}}; line: 1, column: 95]
                )

        )

)

There are no information on Google and StackOverflow about the issue.

0

There are 0 best solutions below