This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
html, body { font-family:tahoma, sans-serif; } h2 { height:15px; font-size:80%; } h2 a { text-decoration: none; color: #393939; } h2 a:hover { text-decoration: underline; } .failed { background-color:#EFC0C0; color:#393939; margin:5px 0 0 0; padding:5px 5px 3px 5px; } .ok { background-color:#C0EFC0; color:#393939; margin:5px 0 0 0; padding:5px 5px 3px 5px; } .ignored { background-color:#EFEFC0; color:#393939; margin:5px 0 0 0; padding:5px 5px 3px 5px; } div.node { border:1px solid #DCE2E8; padding:5px 5px 3px 5px; } div.exception { background-color:#E3E9EF; white-space: pre; color:#393939; height:15px; border-bottom:2px solid #DCE2E8; font-family:monospace; font-size:80%; margin:0; padding:5px 5px 3px 5px; } div.failMessage { background-color:#EFC0C0; white-space: pre; color:#393939; height:15px; font-family:monospace; font-size:80%; margin:0; padding:3px 5px 3px 5px; } div.ignoreMessage { background-color:#EFEFC0; white-space: pre; color:#393939; height:15px; font-family:monospace; font-size:80%; margin:0; padding:3px 5px 3px 5px; } div.stacktrace { background-color:#F1F4F7; white-space: pre; overflow:auto; color:#8B0000; font-family:monospace; font-size:80%; margin:0 0 5px 0; padding:8px 5px 8px 5px; } div.output { white-space: pre; overflow:auto; font-family:monospace; font-size:80%; margin:0 0 5px 0; padding:8px 5px 8px 5px; } .hoverCtrlClickLink { text-decoration: underline; cursor: pointer; } .normalCtrlClickLink { } // When I run this Code: var work = UnitOfWorkFactory.NewMyCards; I get this Error and Output When I have a one to many eager load on PartDef.Parts and a second one to many eager load on Part.PartShippers. If I remove the Second Eager Load Part->PartShippers All works fine.
UnitTest1.TestMethod1 : FailedSELECT
t0.Id AS [t0.Id], t0.AssemblieId AS [t0.AssemblieId], t0.BevelEnd1 AS [t0.BevelEnd1], t0.BevelEnd2 AS [t0.BevelEnd2], t0.DeletedOn AS [t0.DeletedOn], t0.Grade AS [t0.Grade], t0.Hold AS [t0.Hold], t0.IssueToFabrication AS [t0.IssueToFabrication], t0.Length AS [t0.Length], t0.MGradeId AS [t0.MGradeId], t0.MSizeId AS [t0.MSizeId], t0.MTypeId AS [t0.MTypeId], t0.MainPart AS [t0.MainPart], t0.Mark AS [t0.Mark], t0.Notes AS [t0.Notes], t0.ParentPart AS [t0.ParentPart], t0.PartName AS [t0.PartName], t0.ShipLoose AS [t0.ShipLoose], t0.Size AS [t0.Size], t0.Type AS [t0.Type], t0.Weight AS [t0.Weight] FROM PartDef t0 INNER JOIN Assemblie t1 ON t0.AssemblieId = t1.Id INNER JOIN Drawing t2 ON t1.DrawingId = t2.Id INNER JOIN Extra t3 ON t2.ExtraId = t3.Id WHERE (EXISTS ( SELECT t1.* FROM Assemblie t1 WHERE t1.Id = t0.AssemblieId AND EXISTS ( SELECT t2.* FROM Drawing t2 WHERE t2.Id = t1.DrawingId AND EXISTS ( SELECT t3.* FROM Extra t3 WHERE t3.Id = t2.ExtraId AND t3.ExtraNo = 'X1' ) ) ) AND t0.DeletedOn IS NULL); SELECT Part.Id, Part.Cut, Part.DeletedOn, Part.Hold, Part.Locked, Part.MaterialId, Part.PartDefId, Part.Quan FROM Part WHERE (EXISTS ( SELECT t0.* FROM PartDef t0 INNER JOIN Assemblie t1 ON t0.AssemblieId = t1.Id INNER JOIN Drawing t2 ON t1.DrawingId = t2.Id INNER JOIN Extra t3 ON t2.ExtraId = t3.Id WHERE t0.Id = Part.PartDefId AND (EXISTS ( SELECT t1.* FROM Assemblie t1 WHERE t1.Id = t0.AssemblieId AND EXISTS ( SELECT t2.* FROM Drawing t2 WHERE t2.Id = t1.DrawingId AND EXISTS ( SELECT t3.* FROM Extra t3 WHERE t3.Id = t2.ExtraId AND t3.ExtraNo = 'X1' ) ) ) AND t0.DeletedOn IS NULL) ) AND Part.DeletedOn IS NULL); SELECT PartShipperItem.Id, PartShipperItem.PartId, PartShipperItem.ShipperItemId FROM PartShipperItem WHERE EXISTS ( SELECT Part.* FROM Part INNER JOIN Assemblie t1 ON t0.AssemblieId = t1.Id INNER JOIN Drawing t2 ON t1.DrawingId = t2.Id INNER JOIN Extra t3 ON t2.ExtraId = t3.Id WHERE Part.Id = PartShipperItem.PartId AND EXISTS ( SELECT t0.* FROM PartDef t0 WHERE t0.Id = Part.PartDefId AND (EXISTS ( SELECT t1.* FROM Assemblie t1 WHERE t1.Id = t0.AssemblieId AND EXISTS ( SELECT t2.* FROM Drawing t2 WHERE t2.Id = t1.DrawingId AND EXISTS ( SELECT t3.* FROM Extra t3 WHERE t3.Id = t2.ExtraId AND t3.ExtraNo = 'X1' ) ) ) AND t0.DeletedOn IS NULL) ) ) --> Time: 0 ms Test method MyCards.Tests.UnitTest1.TestMethod1 threw exception: System.Data.SqlClient.SqlException:
The multi-part identifier "t0.AssemblieId" could not be bound..
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at Mindscape.LightSpeed.Data.CommandRunner.<>c__DisplayClass4.<ExecuteReader>b__3() in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\Data\CommandRunner.cs: line 22 at Mindscape.LightSpeed.Data.CommandRunner.Execute(IUnitOfWork unitOfWork, IDbCommand command, CommandExecHandler handler) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\Data\CommandRunner.cs: line 61 at Mindscape.LightSpeed.Data.CommandRunner.ExecuteReader(IUnitOfWork unitOfWork, IDbCommand command) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\Data\CommandRunner.cs: line 22 at Mindscape.LightSpeed.Data.BatchingQueryExecutionStrategy..ctor(IUnitOfWork unitOfWork, IEnumerable`1 sqlStatements) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\Data\BatchingQueryExecutionStrategy.cs: line 24 at Mindscape.LightSpeed.Data.DataProviderAdapter.CreateQueryExecutionStrategy(IUnitOfWork unitOfWork, IEnumerable`1 sqlStatements) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\Data\DataProviderAdapter.cs: line 83 at Mindscape.LightSpeed.Mapping.ObjectLoader.LoadInternal(TypeModel typeModel, Query query, IList results) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\Mapping\ObjectLoader.cs: line 50 at Mindscape.LightSpeed.QueryingEngine.FindInternal(Query query, TypeModel typeModel, IList results) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\QueryingEngine.cs: line 338 at Mindscape.LightSpeed.QueryingEngine.Find(Query query, IList results) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\QueryingEngine.cs: line 94 at Mindscape.LightSpeed.UnitOfWork.Find(Query query, IList results) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\UnitOfWork.cs: line 196 at Mindscape.LightSpeed.UnitOfWorkBase.Find(Query query) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework\UnitOfWorkBase.cs: line 420 at Mindscape.LightSpeed.Linq.Plan.SingleQueryPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework.Linq\Plan\SingleQueryPlan.cs: line 53 at Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework.Linq\QueryProvider.cs: line 85 at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework.Linq\QueryProvider.cs: line 60 at Mindscape.LightSpeed.Linq.LinqQuery`1.GetEnumerator() in D:\Users\Tommy\Documents\Visual Studio 2008\Projects\LigthSpeed 3.0 Source\Src\Framework.Linq\Query.cs: line 57 at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList(IEnumerable`1 source) at MyCards.Tests.UnitTest1.TestMethod1() in UnitTest1.cs: line 70 |
|
|
Hi Tommy, Are you using a recent nightly build? If not, can you please try updating and rechecking the error - we resolved a few errors in this area during January. If you are using a recent nightly build, would you be able to send through a small repro sample of this behavior and we can have a look into it.
Thanks! Jeremy |
|