[DDC-3346] Failing test for issue (bad findOneBy behaviour with eager fetch)#1277
[DDC-3346] Failing test for issue (bad findOneBy behaviour with eager fetch)#1277scaytrase wants to merge 3 commits into
Conversation
|
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-3531 We use Jira to track the state of pull requests and the versions they got |
|
Wondering about the resolution path for this: my opinion is that we should just disable the eager loading when a |
|
@Ocramius I've updated test. Does it looks right? Generally, I see three options:
|
This is what I'll try doing. The additional queries are a side-effect that cannot be avoided.
Not really possible, as you'll just hit the identity map in this case. I'll look into it though.
This involves going through the paginator API (2 queries), and we really don't want to do that given the horrible amount of paginator-related issues with mssql and other exotic DBMS. |
|
I took a look through the sources, and the problem really occurs with any limit set. I've updated the test to respect this. |
|
Also I realized that offset parameter in I think that disabling eager loading is dirty workaround, because it would have unattended performance impact. Second way is something intermediate. |
Doing the opposite is actually worse, as the state of the loaded entities will be corrupted, and all event listeners will be broken instead. Patching state by refreshing entities is not a good idea. If the user configures eager loads, it's his own fault there: a second query is an acceptable tradeoff. |
|
I have a fix for this, but it's not complete yet. Fix will be applied in 2.5: 2.4.x will probably get an exception message instead (for now). |
…ly created `CachedPersisterContext`
…e newly created `CachedPersisterContext`
…y created `CachedPersisterContext`
…wly created `CachedPersisterContext`
…wly created `CachedPersisterContext`
…ime, depending on choices
…en limiting and fetch-joining to-many eager associations
…ET repository API (must not hydrate collections)
…Up/tearDown of model-related tables)
…sting more than 1 row
|
This bug does not affect 2.4.x, as the eager loading does not work with |
…ly created `CachedPersisterContext`
…e newly created `CachedPersisterContext`
…y created `CachedPersisterContext`
…wly created `CachedPersisterContext`
…wly created `CachedPersisterContext`
…ime, depending on choices
…en limiting and fetch-joining to-many eager associations
…ET repository API (must not hydrate collections)
…Up/tearDown of model-related tables)
…sting more than 1 row
…ling (better to just use private props)
…er-loads-is-failing [DDC-3346] #1277 find one with eager loads is failing
Here is the test for DDC-3346 issue