You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$x = new X;
$em->persist($x);
$em->flush(); // this updates $x in the Neo4j, as I would expect...
$x->setFoo('bar');
$em->flush(); // $x should update
But it doesn't work unless I add another $em->persist($x) after the flush. I would expect that flush() would not effect which entities are managed, but it seems that flushing is effectively executing a clear() as a side effect.
Are my expectations out of whack or is this a bug?
The text was updated successfully, but these errors were encountered:
scott-r-lindsey
changed the title
$em->flush() is not supposed to effect which persisted are managed
$em->flush() is not supposed to effect which entities are managed
Nov 10, 2015
Well I'm looking for some explicit documentation but not really finding it! It just seems to be assumed.
I'm not going to call the behavior wrong -- It's your OGM -- but it definitely differs from Doctrine or MongoODM.
And it seems a little hard to work with. If you break your application up into lots of little components (per the Symfony way), one of them might need to write data, and it should be able to do so without un-persisting objects that the controller expects to hand to twig (because then twig will not be able to lazy-load relations).
I wonder if the fix is as simple as removing one or two lines?
So, if I do the following:
But it doesn't work unless I add another $em->persist($x) after the flush. I would expect that flush() would not effect which entities are managed, but it seems that flushing is effectively executing a clear() as a side effect.
Are my expectations out of whack or is this a bug?
The text was updated successfully, but these errors were encountered: