Getting optimistic lock after traying to update some data

  php, sylius, symfony

When I try to update some data in my database it shows me the following error:
OptimisticLockException.php line 64, The optimistic lock on an entity field.
this is the code that show me this error:

                         $product->setQte($quantity);
                         $product->setHoldQte(0);
                         $vem->persist($product);
                         $vem->flush();

Any Idea plz ?

Source: Ask PHP

LEAVE A COMMENT