-
Notifications
You must be signed in to change notification settings - Fork 934
Fix future queries with non lazy associations #2174
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
Conversation
03927b6
to
1148aa9
Compare
This comment has been minimized.
This comment has been minimized.
27a36e5
to
10f9746
Compare
foreach (var query in _queries) | ||
{ | ||
if (query.CachingInformation != null) | ||
{ | ||
foreach (var cachingInfo in query.CachingInformation.Where(ci => ci.IsCacheable)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cacheBatcher
is also needed when query is not cacheable but loaded entities are cacheable - so it's better to always set it.
@bahusoid is it regression? If so, could you please re-target to 5.2.x? |
f12beb8
to
5e39340
Compare
@@ -103,7 +103,7 @@ public async Task<int> ProcessResultsSetAsync(DbDataReader reader, CancellationT | |||
|
|||
queryInfo.Result = tmpResults; | |||
if (queryInfo.CanPutToCache) | |||
queryInfo.ResultToCache = tmpResults; | |||
queryInfo.ResultToCache = new List<object>(tmpResults); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When merging to master this change should be ignored. The following code is expected in master (no need to wrap in new List
):
queryInfo.ResultToCache = queryCacheBuilder.Result;
Fixes #2173 (some technical details behind this issue can be found here)
Implemented the following fix:
MultiCriteriaImpl
/MultiQueryImpl
)LoadingCollectionEntry.StopLoading
flag that indicates that collection should not be populated. This allows to delay actual collection initialization till all other batch queries are processed (so it's a fix for NH-3350 - Duplicate records using Future() #1293)Issue is introduced in 5.2 with new
QueryBatch
implementation.