Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Unknown payload type issue #22

Closed odiel closed 9 years ago

odiel commented 9 years ago

Hi

I'm not sure which one is the most active repo this one or orientechnologies/PhpOrient, so I'm posting this issue here as well.

I'm having a piece of code that generates Clusters on the fly, depending on the client performing the request.

For this, the first thing I do, is to perform an Insert:

$query = 'INSERT INTO Event CLUSTER '.$clusterName.' CONTENT '.json_encode($event);
$orientDBClient->command($query);

if the commands raises an exception, then I proceed to check if the cluster exists or not, then create the cluster and attach it to the class and as final step, attempt to insert the content once again

$db = $orientDBClient->dbReload();

if (null == $db->getClusterID($clusterName)) {
   $command = 'CREATE CLUSTER '.$clusterName;
   $orientDBClient->command($command);
   $command = 'ALTER CLASS Event ADDCLUSTER '.$clusterName;
   $orientDBClient->command($command);
   $query = 'INSERT INTO Event CLUSTER '.$clusterName.' CONTENT '.json_encode($event);
   $orientDBClient->command($query);
}

The issue comes with the last command execution getting exceptions like these:

PhpOrient\Exceptions\PhpOrientException: Unknown payload type ▒ in .../ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php on line 577

PhpOrient\Exceptions\PhpOrientException: Unknown payload type  in .../ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php on line 577

PhpOrient\Exceptions\PhpOrientException: Unknown payload type % in ..../ostico/phporient/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php on line 577 

Notice that the character after '...payload type' is different for the exact same code.

The last record insert attempt is actually having place, creating the record in the db.

I'm using version 1.1.7

Ostico commented 9 years ago

Hi @odiel ,

the two repositories are always even. I'm working to unify them.

Thanks for reporting this bug.