From: <dav...@us...> - 2008-11-30 00:54:27
|
Revision: 3939 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3939&view=rev Author: davybrion Date: 2008-11-30 00:54:18 +0000 (Sun, 30 Nov 2008) Log Message: ----------- Removed the EntityLoadContext class since it wasn't really used anywhere Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/Loading/LoadContexts.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Engine/Loading/EntityLoadContext.cs Deleted: trunk/nhibernate/src/NHibernate/Engine/Loading/EntityLoadContext.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/Loading/EntityLoadContext.cs 2008-11-29 18:25:20 UTC (rev 3938) +++ trunk/nhibernate/src/NHibernate/Engine/Loading/EntityLoadContext.cs 2008-11-30 00:54:18 UTC (rev 3939) @@ -1,34 +0,0 @@ -using System.Collections; -using System.Data; -using log4net; - -namespace NHibernate.Engine.Loading -{ - public class EntityLoadContext - { - private static readonly ILog log = LogManager.GetLogger(typeof(EntityLoadContext)); - private LoadContexts loadContexts; - private readonly IDataReader resultSet; - private readonly IList hydratingEntities = new ArrayList(20); // todo : need map? the prob is a proper key, right? - - public EntityLoadContext(LoadContexts loadContexts, IDataReader resultSet) - { - this.loadContexts = loadContexts; - this.resultSet = resultSet; - } - - internal void Cleanup() - { - if (!(hydratingEntities.Count == 0)) - { - log.Warn("On CollectionLoadContext#clear, hydratingEntities contained [" + hydratingEntities.Count + "] entries"); - } - hydratingEntities.Clear(); - } - - public override string ToString() - { - return base.ToString() + "<rs=" + resultSet + ">"; - } - } -} Modified: trunk/nhibernate/src/NHibernate/Engine/Loading/LoadContexts.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/Loading/LoadContexts.cs 2008-11-29 18:25:20 UTC (rev 3938) +++ trunk/nhibernate/src/NHibernate/Engine/Loading/LoadContexts.cs 2008-11-30 00:54:18 UTC (rev 3939) @@ -31,7 +31,6 @@ [NonSerialized] private readonly IPersistenceContext persistenceContext; private IDictionary collectionLoadContexts; - private IDictionary entityLoadContexts; private Dictionary<CollectionKey, LoadingCollectionEntry> xrefLoadingCollectionEntries; @@ -72,20 +71,10 @@ { if (collectionLoadContexts != null) { - object tempObject; - tempObject = collectionLoadContexts[resultSet]; - collectionLoadContexts.Remove(resultSet); - CollectionLoadContext collectionLoadContext = (CollectionLoadContext)tempObject; + CollectionLoadContext collectionLoadContext = (CollectionLoadContext)collectionLoadContexts[resultSet]; collectionLoadContext.Cleanup(); + collectionLoadContexts.Remove(resultSet); } - if (entityLoadContexts != null) - { - object tempObject2; - tempObject2 = entityLoadContexts[resultSet]; - entityLoadContexts.Remove(resultSet); - EntityLoadContext entityLoadContext = (EntityLoadContext)tempObject2; - entityLoadContext.Cleanup(); - } } /// <summary> Release internal state associated with *all* result sets. </summary> @@ -104,15 +93,6 @@ } collectionLoadContexts.Clear(); } - if (entityLoadContexts != null) - { - foreach (EntityLoadContext entityLoadContext in entityLoadContexts.Values) - { - log.Warn("fail-safe cleanup (entities) : " + entityLoadContext); - entityLoadContext.Cleanup(); - } - entityLoadContexts.Clear(); - } } /// <summary> @@ -262,24 +242,5 @@ foreach (CollectionKey entryKey in entryKeys) xrefLoadingCollectionEntries.Remove(entryKey); } - - public EntityLoadContext GetEntityLoadContext(IDataReader resultSet) - { - EntityLoadContext context = null; - if (entityLoadContexts == null) - { - entityLoadContexts = IdentityMap.Instantiate(8); - } - else - { - context = (EntityLoadContext)entityLoadContexts[resultSet]; - } - if (context == null) - { - context = new EntityLoadContext(this, resultSet); - entityLoadContexts[resultSet] = context; - } - return context; - } } } Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-29 18:25:20 UTC (rev 3938) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-11-30 00:54:18 UTC (rev 3939) @@ -616,7 +616,6 @@ <Compile Include="Engine\IdentifierValue.cs" /> <Compile Include="Engine\IPersistenceContext.cs" /> <Compile Include="Engine\Loading\CollectionLoadContext.cs" /> - <Compile Include="Engine\Loading\EntityLoadContext.cs" /> <Compile Include="Engine\Loading\LoadContexts.cs" /> <Compile Include="Engine\Loading\LoadingCollectionEntry.cs" /> <Compile Include="Engine\Nullability.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |