2

モデルの初期化に多くの時間 (数時間) かかる EF の問題に直面しています。モデルは以下の通り。A1 から派生したクラスは約 20 個、A2 から派生したクラスは約 30 個あります。

ここに画像の説明を入力

メモリ使用量に関連する問題を修正するために、TPT から TPH 戦略に移行する必要がありました。それ以来、私はこの問題を理解しようとしています。

この問題は、タイプ「A」の単一のインスタンスを作成し、それをList<A>別のエンティティのプロパティに追加して、それらの変更をコミットするだけで発生します。この時点で、すでに約 2.5 時間かかりましたが、まだ変更をコミットしていません。

コードに割り込む (終了するまで約 1 時間待った後) と、コール スタックは次のようになります。

System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.IfThenElse(System.Data.Common.Utils.Boolean.Vertex condition, System.Data.Common.Utils.Boolean.Vertex then, System.Data.Common.Utils.Boolean.Vertex else) + 0x14e bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.And.AnonymousMethod__1(System.Data.Common.Utils.Boolean.Vertex left, System.Data.Common.Utils.Boolean.Vertex right) + 0x29 bytes 
System.Core.dll!System.Linq.Enumerable.Aggregate<System.Data.Common.Utils.Boolean.Vertex,System.Data.Common.Utils.Boolean.Vertex>(System.Collections.Generic.IEnumerable<System.Data.Common.Utils.Boolean.Vertex> source, System.Data.Common.Utils.Boolean.Vertex seed, System.Func<System.Data.Common.Utils.Boolean.Vertex,System.Data.Common.Utils.Boolean.Vertex,System.Data.Common.Utils.Boolean.Vertex> func) + 0x99 bytes 
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Solver.And(System.Collections.Generic.IEnumerable<System.Data.Common.Utils.Boolean.Vertex> children) + 0x90 bytes   
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.ToDecisionDiagramConverter<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>>.VisitAnd(System.Data.Common.Utils.Boolean.AndExpr<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>> expression) + 0x77 bytes 
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.AndExpr<System.__Canon>.Accept<System.__Canon>(System.Data.Common.Utils.Boolean.Visitor<System.__Canon,System.__Canon> visitor) + 0xc bytes 
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.ToDecisionDiagramConverter<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>>.TranslateToRobdd(System.Data.Common.Utils.Boolean.BoolExpr<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>> expr, System.Data.Common.Utils.Boolean.ConversionContext<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>> context) + 0x72 bytes 
System.Data.Entity.dll!System.Data.Common.Utils.Boolean.Converter<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>>.Converter(System.Data.Common.Utils.Boolean.BoolExpr<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>> expr, System.Data.Common.Utils.Boolean.ConversionContext<System.Data.Common.Utils.Boolean.DomainConstraint<System.Data.Mapping.ViewGeneration.Structures.BoolLiteral,System.Data.Mapping.ViewGeneration.Structures.Constant>> context) + 0x46 bytes 
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.QueryRewriting.FragmentQueryProcessor.IsSatisfiable(System.Data.Mapping.ViewGeneration.Structures.BoolExpression condition) + 0xac bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.QueryRewriting.FragmentQueryProcessor.IsSatisfiable(System.Data.Mapping.ViewGeneration.QueryRewriting.FragmentQuery query) + 0x8 bytes    
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.Structures.CellTreeNode.IsEmptyRightFragmentQuery.get() + 0x1e bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.BasicViewGenerator.IsDisjoint(System.Data.Mapping.ViewGeneration.Structures.CellTreeNode n1, System.Data.Mapping.ViewGeneration.Structures.CellTreeNode n2) + 0xbb bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.BasicViewGenerator.TryAddChildToGroup(System.Data.Mapping.ViewGeneration.Structures.CellTreeOpType opTypeToIsolate, System.Data.Mapping.ViewGeneration.Structures.CellTreeNode childNode, System.Data.Mapping.ViewGeneration.Structures.OpCellTreeNode groupNode) + 0x3f bytes    
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.BasicViewGenerator.IsolateByOperator(System.Data.Mapping.ViewGeneration.Structures.CellTreeNode rootNode, System.Data.Mapping.ViewGeneration.Structures.CellTreeOpType opTypeToIsolate) + 0x1eb bytes 
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.BasicViewGenerator.CreateViewExpression() + 0xeb bytes    
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.QueryRewriting.QueryRewriter.GenerateViewComponents() + 0x12a bytes   
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.ViewGenerator.GenerateViewsForExtentAndType(System.Data.Metadata.Edm.EdmType generatedType, System.Data.Mapping.ViewGeneration.ViewgenContext context, System.Data.Mapping.ViewGeneration.Structures.CqlIdentifiers identifiers, System.Data.Common.Utils.KeyToListMap<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView> views, System.Data.Mapping.ViewGeneration.ViewGenMode mode) + 0x2f bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.ViewGenerator.GenerateDirectionalViewsForExtent(System.Data.Mapping.ViewGeneration.Structures.ViewTarget viewTarget, System.Data.Metadata.Edm.EntitySetBase extent, System.Data.Mapping.ViewGeneration.Structures.CqlIdentifiers identifiers, System.Data.Common.Utils.KeyToListMap<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView> views) + 0x58 bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.ViewGenerator.GenerateDirectionalViews(System.Data.Mapping.ViewGeneration.Structures.ViewTarget viewTarget, System.Data.Mapping.ViewGeneration.Structures.CqlIdentifiers identifiers, System.Data.Common.Utils.KeyToListMap<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView> views) + 0xce bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.ViewGenerator.GenerateAllBidirectionalViews(System.Data.Common.Utils.KeyToListMap<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView> views, System.Data.Mapping.ViewGeneration.Structures.CqlIdentifiers identifiers) + 0xd7 bytes  
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.ViewgenGatekeeper.GenerateViewsFromCells(System.Collections.Generic.List<System.Data.Mapping.ViewGeneration.Structures.Cell> cells, System.Data.Mapping.ViewGeneration.ConfigViewGenerator config, System.Data.Mapping.ViewGeneration.Structures.CqlIdentifiers identifiers, System.Data.Mapping.StorageEntityContainerMapping containerMapping) + 0x1aa bytes    
System.Data.Entity.dll!System.Data.Mapping.ViewGeneration.ViewgenGatekeeper.GenerateViewsFromMapping(System.Data.Mapping.StorageEntityContainerMapping containerMapping, System.Data.Mapping.ViewGeneration.ConfigViewGenerator config) + 0xbf bytes    
System.Data.Entity.dll!System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedGenerateViews(System.Data.Mapping.StorageEntityContainerMapping entityContainerMap, System.Collections.Generic.Dictionary<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView> resultDictionary) + 0x3a bytes  
System.Data.Entity.dll!System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedGetGeneratedViews(System.Data.Metadata.Edm.EntityContainer container) + 0xd2 bytes 
System.Data.Entity.dll!System.Data.Common.Utils.Memoizer<System.__Canon,System.__Canon>.Evaluate.AnonymousMethod__0() + 0x13 bytes  
System.Data.Entity.dll!System.Data.Common.Utils.Memoizer<System.Data.Metadata.Edm.EntityContainer,System.Collections.Generic.Dictionary<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView>>.Result.GetValue() + 0x69 bytes    
System.Data.Entity.dll!System.Data.Common.Utils.Memoizer<System.Data.Metadata.Edm.EntityContainer,System.Collections.Generic.Dictionary<System.Data.Metadata.Edm.EntitySetBase,System.Data.Mapping.ViewGeneration.GeneratedView>>.Evaluate(System.Data.Metadata.Edm.EntityContainer arg) + 0x6e bytes   
System.Data.Entity.dll!System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.GetGeneratedView(System.Data.Metadata.Edm.EntitySetBase extent, System.Data.Metadata.Edm.MetadataWorkspace workspace, System.Data.Mapping.StorageMappingItemCollection storageMappingItemCollection) + 0x49 bytes    
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.ViewLoader.InitializeEntitySet(System.Data.Metadata.Edm.EntitySetBase entitySetBase, System.Data.Metadata.Edm.MetadataWorkspace workspace) + 0x74 bytes  
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.ViewLoader.SyncInitializeEntitySet<System.__Canon,System.__Canon>(System.Data.Metadata.Edm.EntitySetBase entitySetBase, System.Data.Metadata.Edm.MetadataWorkspace workspace, System.Func<System.__Canon,System.__Canon> evaluate, System.__Canon arg) + 0xdf bytes  
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.ViewLoader.SyncGetValue<System.Data.Metadata.Edm.AssociationSet,System.Data.Mapping.Update.Internal.AssociationSetMetadata>(System.Data.Metadata.Edm.EntitySetBase entitySetBase, System.Data.Metadata.Edm.MetadataWorkspace workspace, System.Collections.Generic.Dictionary<System.Data.Metadata.Edm.AssociationSet,System.Data.Mapping.Update.Internal.AssociationSetMetadata> dictionary, System.Data.Metadata.Edm.AssociationSet key) + 0x9c bytes  
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.UpdateTranslator.ValidateAndRegisterStateEntry(System.Data.IEntityStateEntry stateEntry) + 0x109 bytes   
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.UpdateTranslator.LoadStateEntry(System.Data.IEntityStateEntry stateEntry) + 0x23 bytes   
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.UpdateTranslator.PullModifiedEntriesFromStateManager() + 0x156 bytes 
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.UpdateTranslator.ProduceCommands() + 0x1a bytes  
System.Data.Entity.dll!System.Data.Mapping.Update.Internal.UpdateTranslator.Update(System.Data.IEntityStateManager stateManager, System.Data.IEntityAdapter adapter) + 0xc9 bytes   
System.Data.Entity.dll!System.Data.EntityClient.EntityAdapter.Update(System.Data.IEntityStateManager entityCache) + 0x93 bytes  
System.Data.Entity.dll!System.Data.Objects.ObjectContext.SaveChanges(System.Data.Objects.SaveOptions options) + 0x23c bytes 
EntityFramework.dll!System.Data.Entity.Internal.InternalContext.SaveChanges() + 0x144 bytes 
EntityFramework.dll!System.Data.Entity.Internal.LazyInternalContext.SaveChanges() + 0x36 bytes  
EntityFramework.dll!System.Data.Entity.DbContext.SaveChanges() + 0x35 bytes
4

1 に答える 1

2

あなたが示したスタックトレースから、問題はビューの生成にあるように見えます。最初にコードを使用しているので、ビュー生成のパフォーマンスが向上したEF6を試してみることをお勧めします。回避策としての以前のバージョンでは、ビューを事前に生成できます(たとえば、EF Power Toolsまたは私が作成したテンプレートhttp://visualstudiogallery.msdn.microsoft.com/ae7730ce-ddab-470f-8456-1b313cd2c44dを使用)。ビューの作成にはまだ時間がかかりますが、実行時ではなく設計時に行われます。

于 2013-01-15T00:22:20.883 に答える