Skip to content

Commit 1f6db2a

Browse files
committed
Regenerate with AsyncGenerator 0.8.2.4
1 parent b4b49c0 commit 1f6db2a

File tree

1 file changed

+19
-26
lines changed

1 file changed

+19
-26
lines changed

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

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -449,40 +449,33 @@ protected virtual async Task<object> LoadFromSecondLevelCacheAsync(LoadEvent @ev
449449

450450
Task<object> AssembleAsync(CacheKey ck, object ce, LoadEvent evt, bool alterStatistics)
451451
{
452-
try
452+
if (factory.Statistics.IsStatisticsEnabled && alterStatistics)
453453
{
454-
if (factory.Statistics.IsStatisticsEnabled && alterStatistics)
454+
if (ce == null)
455455
{
456-
if (ce == null)
457-
{
458-
factory.StatisticsImplementor.SecondLevelCacheMiss(persister.Cache.RegionName);
459-
log.Debug("Entity cache miss: {0}", ck);
460-
}
461-
else
462-
{
463-
factory.StatisticsImplementor.SecondLevelCacheHit(persister.Cache.RegionName);
464-
log.Debug("Entity cache hit: {0}", ck);
465-
}
456+
factory.StatisticsImplementor.SecondLevelCacheMiss(persister.Cache.RegionName);
457+
log.Debug("Entity cache miss: {0}", ck);
466458
}
467-
468-
if (ce != null)
459+
else
469460
{
470-
CacheEntry entry = (CacheEntry) persister.CacheEntryStructure.Destructure(ce, factory);
471-
472-
// Entity was found in second-level cache...
473-
// NH: Different behavior (take a look to options.ExactPersister (NH-295))
474-
if (!options.ExactPersister || persister.EntityMetamodel.SubclassEntityNames.Contains(entry.Subclass))
475-
{
476-
return AssembleCacheEntryAsync(entry, evt.EntityId, persister, evt, cancellationToken);
477-
}
461+
factory.StatisticsImplementor.SecondLevelCacheHit(persister.Cache.RegionName);
462+
log.Debug("Entity cache hit: {0}", ck);
478463
}
479-
480-
return Task.FromResult<object>(null);
481464
}
482-
catch (Exception ex)
465+
466+
if (ce != null)
483467
{
484-
return Task.FromException<object>(ex);
468+
CacheEntry entry = (CacheEntry) persister.CacheEntryStructure.Destructure(ce, factory);
469+
470+
// Entity was found in second-level cache...
471+
// NH: Different behavior (take a look to options.ExactPersister (NH-295))
472+
if (!options.ExactPersister || persister.EntityMetamodel.SubclassEntityNames.Contains(entry.Subclass))
473+
{
474+
return AssembleCacheEntryAsync(entry, evt.EntityId, persister, evt, cancellationToken);
475+
}
485476
}
477+
478+
return Task.FromResult<object>(null);
486479
}
487480
}
488481

0 commit comments

Comments
 (0)