-
Notifications
You must be signed in to change notification settings - Fork 376
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
AutoFetch doesn't work beyond a depth of 2 with (inversed) hasOne relationships #340
Comments
I'm not sure if I should make a new issue for this, but I'm also noticing that autoFetch doesn't use JOIN queries to get its data, is there a reason for this? |
About the bug, I think I saw a line that could be doing this, but I'm not sure, I need to investigate. |
I have also observed random behaviour using autoFetch: I have exactly the same set-up in terms of inverse associations described by caske33. |
This still doesn't work btw. Nor with the cache disabled globally nor locally (like I did in the initial post). |
FYI, disabling cache and turning all models into autoFetch (at the schema level) fixed for me. The findChain syntax is ideal, where we can disable cache and force a deep auto-fetch on a query-by-query basis. The current situation is disabling cache at a global level really slams the DB connection. |
Is this a problem with the autoFetch state relative to caller and the cache? Historically, when something like this comes up in an ORM, it is because in some scenarios an entity has a state which may or may not contain deep fetch elements based on the context/behavior of the caller. To avoid this, you may consider extending your cache key fields to contain meta-data relative to the auto-fetch history. For instance, if entity is stored by "id" and keyed for hit/miss, you can extend the key to "id_propertyA_propertyB" to identify that the instance is associated to an auto fetch with those fields. Hope this helps. |
My data-structure looks like this:
now when I do
I don't get my players into the match object :(
The text was updated successfully, but these errors were encountered: