I just downloaded the latest version (11/3/2009). And receive new error in very simple situation.

Object model:

[HierarchyRoot]
    public abstract class AbstractObject : Entity
    {
        [Field, Key]
        public Guid Id { get; private set; }
    }
    public abstract class BlogPost : AbstractObject
    {
        [Field]
        public SitePage SitePage { get; set; }
    }
    public sealed class Article : BlogPost
    {
    }
    public sealed class SitePage : AbstractObject
    {
        [Field]
        public string Url { get; set; }
    }

And the query:

return Query<BlogPost>.All.Where(p => p.SitePage.Url == url).SingleOrDefault();

I receive StorageException with this message:

Error 'Unknown' while executing query 'SELECT TOP 2 [a].[Id], [a].[TypeId], [a].[CreatedOn], [a].[CreatedBy.Id], [b].[Category.Id], [b].[Title], [b].[PublishedOn], [b].[TeaserImage.Id], [b].[SitePage.Id] FROM (SELECT [c].[Id], [c].[TypeId], [c].[Category.Id], [c].[Title], [c].[PublishedOn], [c].[TeaserImage.Id], [c].[SitePage.Id] FROM [dbo].[BlogPost] [c]) [b] INNER JOIN (SELECT [d].[Id], [d].[TypeId], [d].[CreatedOn], [d].[CreatedBy.Id] FROM [dbo].[AbstractObject] [d]) [a] ON ([a].[Id] = [b].[Id]) LEFT OUTER JOIN (SELECT [e].[Id], [e].[TypeId], [e].[Site.Id], [e].[Parent.Id], [e].[Url], [e].[Title], [e].[SeoTitle], [e].[SeoDescription] FROM [dbo].[SitePage] [e]) [f] INNER JOIN (SELECT [g].[Id], [g].[TypeId], [g].[CreatedOn], [g].[CreatedBy.Id] FROM [dbo].[AbstractObject] [g]) [h] ON ([h].[Id] = [f].[Id]) ON ([b].[SitePage.Id] = [f].[Id]) WHERE ([#a.Url] = @p0_0) ORDER BY [a].[Id] ASC, [#a.Id] ASC'.

StackTrace:

>   Xtensive.Storage.Providers.Sql.DLL!Xtensive.Storage.Providers.Sql.Driver.ExecuteReader(Xtensive.Storage.Session session = FullName = "Default, #8", System.Data.Common.DbCommand command = {System.Data.SqlClient.SqlCommand}) Line 139 C#
    Xtensive.Storage.Providers.Sql.DLL!Xtensive.Storage.Providers.Sql.Command.ExecuteReader() Line 54 + 0x43 bytes  C#
    Xtensive.Storage.Providers.Sql.DLL!Xtensive.Storage.Providers.Sql.BatchingCommandProcessor.ExecuteBatch(int numberOfTasks = 0, Xtensive.Storage.Providers.Sql.SqlQueryRequest lastRequest = {Xtensive.Storage.Providers.Sql.SqlQueryRequest}) Line 69 + 0xe bytes   C#
    Xtensive.Storage.Providers.Sql.DLL!Xtensive.Storage.Providers.Sql.BatchingCommandProcessor.ExecuteRequestsWithReader(Xtensive.Storage.Providers.Sql.SqlQueryRequest request = {Xtensive.Storage.Providers.Sql.SqlQueryRequest}) Line 37 + 0x2b bytes    C#
    Xtensive.Storage.Providers.Sql.DLL!Xtensive.Storage.Providers.Sql.SessionHandler.ExecuteTupleReader.MoveNext() Line 131 + 0x1a bytes    C#
    Xtensive.Storage.Providers.Sql.DLL!Xtensive.Storage.Providers.Sql.SqlProvider.OnEnumerate.MoveNext() Line 48 + 0xc bytes    C#
    Xtensive.Storage.Rse.DLL!Xtensive.Storage.Rse.Providers.ExecutableProvider.GetEnumerator.MoveNext() Line 217 + 0x8e bytes   C#
    Xtensive.Core.DLL!Xtensive.Core.Collections.EnumerableExtensions.Batch<Xtensive.Core.Tuples.Tuple>(System.Collections.Generic.IEnumerable<Xtensive.Core.Tuples.Tuple> source = "SqlProvider", Source count = 1, int firstFastCount = 2, int initialBatchSize = 8, int maximalBatchSize = 1024) Line 483 + 0x1e bytes    C#
    Xtensive.Core.DLL!Xtensive.Core.Collections.EnumerableExtensions.ApplyBeforeAndAfter<Xtensive.Core.Tuples.Tuple>(System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<Xtensive.Core.Tuples.Tuple>> source = {Xtensive.Core.Collections.EnumerableExtensions.Batch<Xtensive.Core.Tuples.Tuple>}, System.Action beforeAction = {Method = {Void <GetEnumerator>b__0()}}, System.Action afterAction = {Method = {Void <GetEnumerator>b__1()}}) Line 579 + 0xc bytes    C#
    Xtensive.Storage.Rse.DLL!Xtensive.Storage.Rse.RecordSet.GetEnumerator.MoveNext() Line 71 + 0x12c bytes  C#
    [External Code] 
    Xtensive.Core.DLL!Xtensive.Core.Collections.EnumerableExtensions.Batch<W3P.Model.BlogPost>(System.Collections.Generic.IEnumerable<W3P.Model.BlogPost> source = {System.Linq.Enumerable.WhereSelectEnumerableIterator<Xtensive.Core.Tuples.Tuple,W3P.Model.BlogPost>}, int firstFastCount = 2, int initialBatchSize = 32, int maximalBatchSize = 1024) Line 483 + 0x1e bytes C#
    Xtensive.Core.DLL!Xtensive.Core.Collections.EnumerableExtensions.ApplyBeforeAndAfter<W3P.Model.BlogPost>(System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<W3P.Model.BlogPost>> source = {Xtensive.Core.Collections.EnumerableExtensions.Batch<W3P.Model.BlogPost>}, System.Action beforeAction = {Method = {Void <Materialize>b__1()}}, System.Action afterAction = {Method = {Void <Materialize>b__2()}}) Line 579 + 0xc bytes    C#
    Xtensive.Storage.DLL!Xtensive.Storage.Linq.Materialization.MaterializationHelper.Materialize<W3P.Model.BlogPost>.MoveNext() Line 97 + 0x282 bytes   C#
    [External Code] 
    Xtensive.Core.DLL!Xtensive.Core.Helpers.DelegateBindExtensions.Bind<object[],System.Collections.Generic.IEnumerable<Xtensive.Core.Tuples.Tuple>,System.Collections.Generic.Dictionary<Xtensive.Core.Parameters.Parameter<Xtensive.Core.Tuples.Tuple>,Xtensive.Core.Tuples.Tuple>,W3P.Model.BlogPost>.AnonymousMethod(System.Collections.Generic.IEnumerable<Xtensive.Core.Tuples.Tuple> arg2 = {Select (Id, TypeId, CreatedOn, CreatedBy.Id, Category.Id, Title, PublishedOn, TeaserImage.Id, SitePage.Id)
  Take (System.Func`1[System.Int32])
    Filter (tuple => (tuple.GetValueOrDefault(15) == @.url))
      Join (LeftOuter, SitePage.Id == #a.Id)
        Index (Index 'PK_BlogPost.AbstractObject.JOIN' @ BlogPost)
        Alias (#a)
          Index (Index 'PK_SitePage.AbstractObject.JOIN' @ SitePage)
}, System.Collections.Generic.Dictionary<Xtensive.Core.Parameters.Parameter<Xtensive.Core.Tuples.Tuple>,Xtensive.Core.Tuples.Tuple> arg3 = Count = 0) Line 46 + 0x26 bytes  C#
    Xtensive.Storage.DLL!Xtensive.Storage.Linq.TranslatedQuery<W3P.Model.BlogPost>.Execute() Line 32 + 0x2f bytes   C#
    Xtensive.Storage.DLL!Xtensive.Storage.Linq.QueryProvider.Execute<W3P.Model.BlogPost>(System.Linq.Expressions.Expression expression = {Query<BlogPost>.All.Where(p => (p.SitePage.Url = value(W3P.Services.DataService+<>c__DisplayClass13).url)).SingleOrDefault()}) Line 59 + 0xb bytes    C#

This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by buck.

asked Nov 03 '09 at 23:14

Editor's gravatar image

Editor
46147156157

It seems clear where error is: by some reason our SQL DOM translator used #a instead of a in the tail of this query. So we'll try to fix this ASAP.

(Nov 03 '09 at 23:14) Alex Yakunin Alex%20Yakunin's gravatar image

Fixed in the latest nightly build.

(Nov 03 '09 at 23:14) Alex Yakunin Alex%20Yakunin's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA