Skip to content
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

Add entity name for mutable read-only cache log #3268

Merged
merged 2 commits into from
Mar 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/NHibernate/Impl/SessionFactoryImpl.cs
Original file line number Diff line number Diff line change
@@ -270,6 +270,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
model.RootClazz.CacheRegionName,
model.CacheConcurrencyStrategy,
model.IsMutable,
model.EntityName,
caches);
var cp = PersisterFactory.CreateClassPersister(model, cache, this, mapping);
entityPersisters[model.EntityName] = cp;
@@ -290,6 +291,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
model.CacheRegionName,
model.CacheConcurrencyStrategy,
model.Owner.IsMutable,
model.OwnerEntityName,
caches);
var persister = PersisterFactory.CreateCollectionPersister(model, cache, this);
collectionPersisters[model.Role] = persister;
@@ -446,10 +448,10 @@ private IQueryCache BuildQueryCache(string queryCacheName)
properties);
}

private ICacheConcurrencyStrategy GetCacheConcurrencyStrategy(
string cacheRegion,
private ICacheConcurrencyStrategy GetCacheConcurrencyStrategy(string cacheRegion,
string strategy,
bool isMutable,
string entityName,
Dictionary<Tuple<string, string>, ICacheConcurrencyStrategy> caches)
{
if (strategy == null || !settings.IsSecondLevelCacheEnabled)
@@ -462,7 +464,7 @@ private ICacheConcurrencyStrategy GetCacheConcurrencyStrategy(
cache = CacheFactory.CreateCache(strategy, GetCache(cacheRegion), settings);
caches.Add(cacheKey, cache);
if (isMutable && strategy == CacheFactory.ReadOnly)
log.Warn("read-only cache configured for mutable: {0}", name);
log.Warn("read-only cache configured for mutable: {0}", entityName);

return cache;
}