Skip to content

Commit cc61512

Browse files
Do missing async generation for cache batch optimization
Fixup of #1955
1 parent 5873ddb commit cc61512

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/NHibernate/Async/Event/Default/DefaultInitializeCollectionEventListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private async Task<bool> InitializeCollectionFromCacheAsync(
9595
CollectionEntry[] collectionEntries = null;
9696
var collectionBatch = source.PersistenceContext.BatchFetchQueue.QueryCacheQueue
9797
?.GetCollectionBatch(persister, collectionKey, out collectionEntries);
98-
if ((collectionBatch != null || batchSize > 1) && persister.Cache.PreferMultipleGet())
98+
if (collectionBatch != null || batchSize > 1 && persister.Cache.PreferMultipleGet())
9999
{
100100
// The first item in the array is the item that we want to load
101101
if (collectionBatch != null)

src/NHibernate/Async/Event/Default/DefaultLoadEventListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ protected virtual async Task<object> LoadFromSecondLevelCacheAsync(LoadEvent @ev
416416
var batchSize = persister.GetBatchSize();
417417
var entityBatch = source.PersistenceContext.BatchFetchQueue.QueryCacheQueue
418418
?.GetEntityBatch(persister, @event.EntityId);
419-
if ((entityBatch != null || batchSize > 1) && persister.Cache.PreferMultipleGet())
419+
if (entityBatch != null || batchSize > 1 && persister.Cache.PreferMultipleGet())
420420
{
421421
// The first item in the array is the item that we want to load
422422
if (entityBatch != null)

0 commit comments

Comments
 (0)