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
Entities with Composite Keys behave weirdly when referenced by OneToMany relationships #589
Labels
bug
Something isn't working
Comments
B4nan
added a commit
that referenced
this issue
Jun 1, 2020
B4nan
added a commit
that referenced
this issue
Jun 1, 2020
Closing as fixed in |
B4nan
added a commit
that referenced
this issue
Jun 5, 2020
B4nan
added a commit
that referenced
this issue
Jun 16, 2020
B4nan
added a commit
that referenced
this issue
Aug 2, 2020
B4nan
added a commit
that referenced
this issue
Aug 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If an Entity containing a OneToMany relationship toward another Entity with composite keys is present in the cache, Mikro-ORM will behave strangely depending on how many times you will flush related entities. The first time you flush (one or more entities) it works, then it fires an update query with a non-existing id (0) which leads to a rollback.
I'm unsure about what exactly is happening because I'm not super familiar with the innings of
UnitOfWork
, a repro is pending.Stack trace
To Reproduce
A PR with a failing test is available: #590
Expected behavior
Should work despite the order and/or what's already loaded into the cache.
Additional context
The same works if I use IDs instead of composite keys.
Versions
The text was updated successfully, but these errors were encountered: