Hi,
I have updated LightSpeed Framework to the nightly version from 2-3months old version and I have the following error.
"There is already an open DataReader associated with this Connection which must be closed first."
I think there must be something change since then I have no idea what changed.
I think it's related to "AfterLoad" modification I made.
Ivan, and I talked in great length that I need to initialize entities in "AfterLoad", but reference to other entities are not available in "AfterLoad". I think the name "AfterLoad" is misleading that entity has done reading.
Anyway, with some help from Ivan, I modified AfterLoad so that I can access other entities from it.
I'll post the changes I made as reply.
Here is a call stack when the error occurs.
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Data.CommandRunner.ExecuteReader.AnonymousMethod_3() Line 22 C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Profiling.Interceptor.ExecuteCommand(System.Func baseExecutor = {Method = {System.Reflection.RuntimeMethodInfo}}, Mindscape.LightSpeed.IUnitOfWork unitOfWork = {DB.UMudUnitOfWork}, System.Data.IDbCommand command = {MySql.Data.MySqlClient.MySqlCommand}) Line 59 + 0x11 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Data.CommandRunner.Execute(Mindscape.LightSpeed.IUnitOfWork unitOfWork = {DB.UMudUnitOfWork}, System.Data.IDbCommand command = {MySql.Data.MySqlClient.MySqlCommand}, System.Func handler = {Method = {System.Reflection.RuntimeMethodInfo}}) Line 64 + 0x80 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Data.CommandRunner.ExecuteReader(Mindscape.LightSpeed.IUnitOfWork unitOfWork = {DB.UMudUnitOfWork}, System.Data.IDbCommand command = {MySql.Data.MySqlClient.MySqlCommand}) Line 22 + 0x63 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Data.BatchingQueryExecutionStrategy.BatchingQueryExecutionStrategy(Mindscape.LightSpeed.IUnitOfWork unitOfWork = {DB.UMudUnitOfWork}, System.Collections.Generic.IEnumerable sqlStatements = Count = 1) Line 26 + 0x22 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Data.DataProviderAdapter.CreateQueryExecutionStrategy(Mindscape.LightSpeed.IUnitOfWork unitOfWork = {DB.UMudUnitOfWork}, System.Collections.Generic.IEnumerable sqlStatements = Count = 1, Mindscape.LightSpeed.Data.ProviderOptions providerOptions = null) Line 101 + 0x2f bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.ObjectLoader.LoadInternal(Mindscape.LightSpeed.Model.TypeModel typeModel = {Mindscape.LightSpeed.Model.TypeModel}, Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 58 + 0x126 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.ObjectLoader.Load(Mindscape.LightSpeed.UnitOfWorkBase unitOfWork = {DB.UMudUnitOfWork}, Mindscape.LightSpeed.Model.TypeModel typeModel = {Mindscape.LightSpeed.Model.TypeModel}, Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 21 + 0x43 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.QueryingEngine.FindInternal(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, Mindscape.LightSpeed.Model.TypeModel typeModel = {Mindscape.LightSpeed.Model.TypeModel}, System.Collections.IList results = Count = 0) Line 395 + 0x29 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.QueryingEngine.Find(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 135 + 0x1c bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.UnitOfWork.Find(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 281 + 0x24 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.UnitOfWorkBase.Find(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}) Line 431 + 0x1e bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Entity.LoadCollection(Mindscape.LightSpeed.IEntityCollection entityCollection = Count = 0, Mindscape.LightSpeed.Entity parent = {DB.Map}) Line 1454 + 0x46 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Entity.Get(Mindscape.LightSpeed.EntityCollection entityCollection = Count = 0) Line 965 + 0x14 bytes C#
CommonLib.dll!DB.Map.Layers.get() Line 7344 + 0x1e bytes C#
CommonLib.dll!DB.Map.CacheTopTiles() Line 134 + 0xd bytes C#
CommonLib.dll!DB.Map.AfterLoad() Line 125 + 0xa bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.EntityLoader.LoadEntityFromReader(Mindscape.LightSpeed.Model.AliasedTypeModel typeModel = {Mindscape.LightSpeed.Model.AliasedTypeModel}, object id = 35411, bool allowUnscopedIdentifiers = true, bool isDirect = true) Line 109 + 0x14 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.ObjectLoader.VisitTypeModel(Mindscape.LightSpeed.Model.AliasedTypeModel typeModel = {Mindscape.LightSpeed.Model.AliasedTypeModel}, Mindscape.LightSpeed.Querying.QueryExpression queryExpression = null, Mindscape.LightSpeed.Querying.Order order = null, Mindscape.LightSpeed.Querying.Group group = null, string aggregateName = null, bool includeDeleted = false, bool identifiersOnly = false) Line 259 + 0x75 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.QueryTraversal.Visit(Mindscape.LightSpeed.LightSpeedContext context = {Mindscape.LightSpeed.LightSpeedContext}, System.Collections.Generic.List typeModels = Count = 1, Mindscape.LightSpeed.Querying.QueryExpression queryExpression = null, Mindscape.LightSpeed.Querying.Order order = null, Mindscape.LightSpeed.Querying.Group group = null, string aggregateName = null, bool includeDeleted = false, bool identifiersOnly = false) Line 35 + 0x79 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.ObjectLoader.LoadFromQueryStrategy(Mindscape.LightSpeed.Model.AliasedTypeModel typeModel = {Mindscape.LightSpeed.Model.AliasedTypeModel}, System.Collections.IList results = Count = 0, string aggregateName = null, bool identifiersOnly = false) Line 193 + 0xfc bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.ObjectLoader.LoadInternal(Mindscape.LightSpeed.Model.TypeModel typeModel = {Mindscape.LightSpeed.Model.TypeModel}, Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 74 + 0x23 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.Mapping.ObjectLoader.Load(Mindscape.LightSpeed.UnitOfWorkBase unitOfWork = {DB.UMudUnitOfWork}, Mindscape.LightSpeed.Model.TypeModel typeModel = {Mindscape.LightSpeed.Model.TypeModel}, Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 21 + 0x43 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.QueryingEngine.FindInternal(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, Mindscape.LightSpeed.Model.TypeModel typeModel = {Mindscape.LightSpeed.Model.TypeModel}, System.Collections.IList results = Count = 0) Line 395 + 0x29 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.QueryingEngine.Find(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 135 + 0x1c bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.UnitOfWork.Find(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}, System.Collections.IList results = Count = 0) Line 281 + 0x24 bytes C#
Mindscape.LightSpeed.dll!Mindscape.LightSpeed.UnitOfWorkBase.Find(Mindscape.LightSpeed.Querying.Query query = {Mindscape.LightSpeed.Querying.Query}) Line 431 + 0x1e bytes C#
Mindscape.LightSpeed.Linq.dll!Mindscape.LightSpeed.Linq.Plan.SingleQueryPlan.ExecuteImmediate(Mindscape.LightSpeed.IUnitOfWork unitOfWork = {DB.UMudUnitOfWork}, System.Type returnType = {Name = "Map" FullName = "DB.Map"}) Line 54 + 0x6e bytes C#
Mindscape.LightSpeed.Linq.dll!Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(System.Linq.Expressions.Expression expression = {System.Linq.Expressions.MethodCallExpressionN}) Line 92 + 0x6d bytes C#
Mindscape.LightSpeed.Linq.dll!Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(System.Linq.Expressions.Expression expression = {System.Linq.Expressions.MethodCallExpressionN}) Line 56 + 0xf bytes C#
[External Code]
UMakeEditor.exe!UMake.RibbonBar.RecentDocument OnMouseDoubleClick(object sender = {Telerik.Windows.Controls.RadRibbonButton}, System.Windows.Input.MouseButtonEventArgs e = {System.Windows.Input.MouseButtonEventArgs}) Line 157 + 0x1fe bytes C#
Thanks.
-chris