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
|
I am getting the error below. The model and query is quite complex so I have emailed it to you (Ivan + JB).
|
|
|
btw it looks related to class table inhertiance. LightSpeed is trying to select base table columns from a derived table. |
|
|
What is the query that exhibits the error? Your code has a bunch of conditionals so it could be any of 16 different combinations. All of them? All the ones where a particular conditional is true? Only a particular combination of conditionals? |
|
|
The only filter is a GeographicalAreaId being passed into the method, which resolved to a collection of GeographicalAreaIds. Check out the included SQL for the details. |
|
|
Also all the other filters in the query work but I haven't had the opportunaty to test them in combination with the GeographicalAreaId filter yet because of this error. |
|
|
This bit: if (eventFilter.GeographicalAreaId != null) {
IList<Guid> geographicalAreaIds = Repositories.GeographyRepository.GetGeographicalAreaAndParentsById(eventFilter.GeographicalAreaId.Value) .Select(a => a.Id) .ToList(); events = (from e in events join p in UnitOfWork.Places on e.PlaceId equals p.Id join gac in UnitOfWork.GeographicalAreaCities on p.CityId equals gac.CityId select new {Event = e, GeographicalAreaCity = gac}) .Where(r => geographicalAreaIds.Contains(r.GeographicalAreaCity.GeographicalAreaId)) .Select(r => r.Event); } |
|
|
Another bug: I just noticed that when a category to filter on is provided, although the items are successfully selected (i.e. LightSpeed returns a collection of entities) the properties on the LightSpeed entities are incorrectly all null.
This bit: if (eventFilter.CategoryIds.Count > 0) |
|
|
How close are you guys to resolving this issue? I have been working on other areas the last couple of days but I will be coming back to work on web pages that rely on this stored procedure early next week. |
|
|
And by stored procedure I mean "awesome LightSpeed query that means I don't have to write a stupid stored procedure". :) |
|
|
We are still working on this one so Id stick with the stored proc for now. Will let you know once we have made some progress though.
Jeremy |
|
|
I've discovered I get this error even with very simple queries that combine class table inheritance and joins. LINQ: public IList<Place> GetPlacesFollowedByUserId(Guid userId) The error is the same as what was posted earlier. Will there be a fix for this bug soon? It is an important one for me. |
|
|
We have an initial set of fixes which should cover the issues you have mentioned here. These will be up in tonights nightly build. Let us know if you run into any subsequent issues with your codebase - I believe you had a list of a few things you had noted down :)
Thanks! Jeremy |
|
|
I have upgraded to this nightly - LightSpeed40Professional-20110902.msi - and I have the following LINQ query that errors: public IList<Place> GetPlacesFollowedByUserId(Guid userId) The error: The correlation name 't1_root' is specified multiple times in a FROM clause. I have emailed you the model. |
|
|
Have you made any progress? I have worked around this issue by placing ToList() on the queryable properties so that the join happens in memory but it is important to me that it gets fixed. |
|
|
Hi Iam getting the follwoing error below is the code. Please let me know the work around for this. thanks
ErrorDetails :Invalid column name 'LicenseId'. Stacktrace : at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() 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 ...() at ..(IUnitOfWork , IDbCommand , ) at ..(IUnitOfWork , IDbCommand ) at Mindscape.LightSpeed.Data.DataProviderAdapter.(IUnitOfWork , IEnumerable`1 , ProviderOptions ) at ..(TypeModel , Query , IList ) at ..(Query , TypeModel , IList ) at ..(Query , IList ) at Mindscape.LightSpeed.UnitOfWork.Find(Query query, IList results) at Mindscape.LightSpeed.UnitOfWorkBase.Find(Query query) at Mindscape.LightSpeed.Linq.Plan.SingleQueryPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType) at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression) at System.Linq.Queryable.Single[TSource](IQueryable`1 source, Expression`1 predicate)
companyUserData = uow.CompanyUserDetails.Single(CompanyUserDetail => CompanyUserDetail.Id == inputData.CompanyUserContact.Id); if (companyUserData.CompanyUserType != (short)CompanyUserType.OurCustimer && companyUserData.CompanyUserType != (short)CompanyUserType.NormalCustomer) { return responseData; } licenseDetailsData = uow.LicenseDetails.Single(LicenseDetail => LicenseDetail.Id == inputData.CompanyUserLicense.Id); activationid = licenseDetailsData.ActivtionId; if (licenseDetailsData.LicenseStatus != (short)LicenseStatusType.Deactivated) { if (licenseDetailsData != null) { if (licenseDetailsData.ActivtionId != null && licenseDetailsData.ActivtionId >0)//if activation id = null, it means that the license is not activated yet. Hence, just bypass the check here. { licenseActivation = uow.LicenseActivations.Single(LicenseActivation => LicenseActivation.Id == 47); if (licenseActivation.MachineCode.ToUpper() != inputData.LicenseActivation.MachineCode.ToUpper()) { return responseData; } |
|
|
I'm getting the same issue when joining on a table that uses table inheritance. Was there a fix for this? The correlation name 't1_root' is specified multiple times in a FROM clause. |
|
|
We posted an initial set of fixes but the subsequent issues mentioned by James are still outstanding as they are going to require a reasonable set of changes to implement a fix for. If you are able to send through a repro we can determine if this is the same issue or if this is a separate issue which we may be able to fix independently.
|
|
|
Hi Jeremy, We are also having the problem with 'The correlation name 'x_root' is specified multiple times in a FROM clause.' We are getting this problem because we just tried upgrading to the LS5 nightly build. And we did that to work around this bug: http://www.mindscapehq.com/forums/thread/350704 So, if we don't upgrade, we have the first bug, and if we do we have the second. Ouch! Do you have any update on the correlation name issue? John |
|
|
Actually, I have my own update on our side of the issue: the correlation one is now solved, by re-writing the query. (Instead of starting with parent entity, and joining down to children, it starts with the bottom child, and just uses dotted property paths to apply criteria to parents. That works in LS 5, so our urgent need for your help seems to have passed.) John |
|