ClankBundle icon indicating copy to clipboard operation
ClankBundle copied to clipboard

Doctrine persist on RPC

Open NaxYo opened this issue 11 years ago • 1 comments

Hi!, I'm trying to persist some entity in a RPC service, I have passed the entity manager and I'm able to make queries, so it's working, but when I try to persist some entity it don't work, I'm not getting any error, but the flush order never ends...

    echo 'pre flush ';
    $this->em->flush();
    echo 'post flush '; // never shown

I believe I have some close error to this one, once I was trying to persist on a postpersist cycle event, but in this case I'm not getting any error, so I got no idea whats wrong... any idea?

NaxYo avatar Oct 06 '14 17:10 NaxYo

Workaround:

    $conn = $this->em->getConnection();

    $sql = "
      INSERT INTO ...(...)
      VALUES(...)
    ";
    $stmt = $conn->prepare($sql);
    $stmt->bindValue(':somevalue', ...);
    ....
    $result = $stmt->execute();

it's a very poor solution, if anyone can find out how to do it properly with flush it will be great...

NaxYo avatar Oct 07 '14 11:10 NaxYo