Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PersistentCollection::removeElement with fetch EXTRA_LAZY remove from DB without persist&flush #7728

Open
karakum opened this issue May 31, 2019 · 4 comments
Assignees

Comments

@karakum
Copy link

karakum commented May 31, 2019

Bug Report

Q A
BC Break yes/no
Version 2.6.3

Summary

This code was added a long-long ago in 2011 year...
356f587#r33750844

Current behavior

$collection->removeElement($el) execute sql DELETE before(without) $em->persist()&$em->flush().

How to reproduce

1 Many-to-many collection with fetch="EXTRA_LAZY"
2 Remove element from collection

Expected behavior

There must no DB changes be made without $em->persist()&$em->flush()

@lcobucci
Copy link
Member

lcobucci commented Oct 2, 2019

@karakum changes might still happen without $em->persist(), depending on the tracking policy. However, $em->flush() is a must. Would you be able to send us a functional test reproducing this issue? It would be quite helpful 👍

@lcobucci
Copy link
Member

lcobucci commented Oct 2, 2019

@karakum never mind my comment, this is apparently the way things are designed to work (TIL!)

@karakum
Copy link
Author

karakum commented Oct 2, 2019

@lcobucci could you please give me doc-link about this "feature"?

@lcobucci
Copy link
Member

lcobucci commented Oct 2, 2019

@karakum unfortunately, there's just no documentation for that: #7765

Changing this is a BC break but I believe we have to find a solution to overcome what @guilhermeblanco mentioned in the commit and still make this managed by the UoW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants