-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Commit order issue #5538
Comments
Which version are you using? I have fixed this problem on master (aka. 2.6.0-dev) |
I'm using 2.5.2, any plans of cherry picking this fix into 2.5.3 or do we have to wait until 2.6? When is this scheduled to be release? I can verify that this problem is fixed in master! |
In order to release 2.6, we still need to correct doctrine/data-fixtures#212 :-( |
@kilhage it sounds as if this has been resolved, can you confirm that? |
Your description is incomplete, for example it does not deal with the |
I have a very annoying issue regarding the commit order calculated by the UnitOfWork & CommitOrderCalculator components.
I have two entities, the important parts in this case looks like this:
The code snippet I have problem when looks like this:
Then the following exception will be thrown:
When looking at the sql statements executed I see these in the logs:
If I instead run the following snippet:
The error occurs becouse depending on what entity gets persisted first, the \Doctrine\ORM\UnitOfWork::getCommitOrder will build commit order differently because the two entities are dependent of each other, but since the thumbnail_id is nullable this should still work..
One solution to this would of course be a different approach to the thumbnails but I'd stil expect the above test cases not to throw errors and the commit order to be consistent.
Please suggest a way around this without adding extra flushes, or change the order I persist the objects. I have a number of use cases in the project where this is used where I need to persist the objects in the order as in the test cases and can't add flushes because of performance reasons.
Any help is appreciated, thanks.
The text was updated successfully, but these errors were encountered: