@@ -265,7 +265,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
265
265
#region Persisters
266
266
267
267
var caches = new Dictionary < Tuple < string , string > , ICacheConcurrencyStrategy > ( ) ;
268
- entityPersisters = new Dictionary < string , IEntityPersister > ( ) ;
268
+ var tmpEntityPersisters = new Dictionary < string , IEntityPersister > ( ) ;
269
269
implementorToEntityName = new Dictionary < System . Type , string > ( ) ;
270
270
271
271
Dictionary < string , IClassMetadata > classMeta = new Dictionary < string , IClassMetadata > ( ) ;
@@ -280,7 +280,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
280
280
model . EntityName ,
281
281
caches ) ;
282
282
var cp = PersisterFactory . CreateClassPersister ( model , cache , this , mapping ) ;
283
- entityPersisters [ model . EntityName ] = cp ;
283
+ tmpEntityPersisters [ model . EntityName ] = cp ;
284
284
classMeta [ model . EntityName ] = cp . ClassMetadata ;
285
285
286
286
if ( model . HasPocoRepresentation )
@@ -289,14 +289,16 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
289
289
}
290
290
}
291
291
292
+ entityPersisters = new ReadOnlyDictionary < string , IEntityPersister > ( tmpEntityPersisters ) ;
293
+
292
294
entityPersistersSpaces = entityPersisters
293
295
. SelectMany ( x => x . Value . QuerySpaces . Select ( y => new { QuerySpace = y , Persister = x . Value } ) )
294
296
. ToLookup ( x => x . QuerySpace , x => x . Persister ) ;
295
297
296
298
classMetadata = new ReadOnlyDictionary < string , IClassMetadata > ( classMeta ) ;
297
299
298
300
Dictionary < string , ISet < string > > tmpEntityToCollectionRoleMap = new Dictionary < string , ISet < string > > ( ) ;
299
- var collPersisters = new Dictionary < string , ICollectionPersister > ( ) ;
301
+ var tmpCollectionPersisters = new Dictionary < string , ICollectionPersister > ( ) ;
300
302
foreach ( Mapping . Collection model in cfg . CollectionMappings )
301
303
{
302
304
var cache = GetCacheConcurrencyStrategy (
@@ -306,7 +308,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
306
308
model . OwnerEntityName ,
307
309
caches ) ;
308
310
var persister = PersisterFactory . CreateCollectionPersister ( model , cache , this ) ;
309
- collPersisters [ model . Role ] = persister ;
311
+ tmpCollectionPersisters [ model . Role ] = persister ;
310
312
IType indexType = persister . IndexType ;
311
313
if ( indexType != null && indexType . IsAssociationType && ! indexType . IsAnyType )
312
314
{
@@ -333,7 +335,7 @@ public SessionFactoryImpl(Configuration cfg, IMapping mapping, Settings settings
333
335
}
334
336
}
335
337
336
- collectionPersisters = new ReadOnlyDictionary < string , ICollectionPersister > ( collPersisters ) ;
338
+ collectionPersisters = new ReadOnlyDictionary < string , ICollectionPersister > ( tmpCollectionPersisters ) ;
337
339
338
340
collectionPersistersSpaces = collectionPersisters
339
341
. SelectMany ( x => x . Value . CollectionSpaces . Select ( y => new { QuerySpace = y , Persister = x . Value } ) )
0 commit comments