Ostico / PhpOrient

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

RecordUpdate() in transaction loses data #108

Open K4PSuL opened 5 years ago

K4PSuL commented 5 years ago

Hi,

Im using OrientDB 3.0.18 with PhpOrient 1.3.

When i update record on transaction, attributes of my Vertex is set to null.

Simple example

Schema

CREATE CLASS Test EXTENDS V
CREATE PROPERTY Test.attr1 STRING
CREATE PROPERTY Test.attr2 STRING

Data

CREATE VERTEX Test SET attr1 = "attr1", attr2 = "attr2"

Capture d’écran de 2019-04-12 10-17-41

Php code

    // [...] $phpOrient création...

    $record = $phpOrient->recordLoad(new \PhpOrient\Protocols\Binary\Data\ID('#24:0'));
    $record = $record[0];

    $record->__set('attr1', 'edited field');

    $tx = $phpOrient->getTransactionStatement();
    $tx = $tx->begin();

    $operation  = $phpOrient->recordUpdate($record);
    $tx->attach($operation);

    $tx->commit();

Capture d’écran de 2019-04-12 10-22-04

Result Attributes "attr1" and "attr2" is gone!

Capture d’écran de 2019-04-12 10-21-12 Capture d’écran de 2019-04-12 10-21-27

Do you have an idea for resolve my problem ? I miss something ?

I tried with OrientDB 3.0.15, create new instance of Record before update it, create database/Vertex with differents options... nothing to do, i have a same issue!

Thank you for your help!

K4PSuL commented 5 years ago

Hi!

Someone can help me ? It's pretty simple to reproduce the scenario.

Thanks =D