Issue when expanding into multiple levels with OData

Issue when expanding into multiple levels with OData

Postby jcarter » Thu 26 Mar 2015 16:00

We are creating a OData service using WebAPI, we've used Entity Developer to create our Model and are dotConnect to connect to Oracle.

When attempting to expand multiple levels we receive the exception "Column addition failed for symbol type 'Devart.Common.Entity.ae' and current expression 'Devart.Common.Entity.ae'." Unfortunately the actual EF query is being generated by WebAPI and I could not find a way to extract it for reference.

I was hoping you might have insight on what might be causing the issue, and a potential fix. If there is any additional information I could provide please let me know.

Versions
All packages have been checked for updates and are running the latest versions.
WebAPI 2.2 for OData v1-3 (v5.4.0)
EntityFramework (v6.1.3)
dotConnect (v8.4.379)
Oracle (12g)

OData URL for reference
http://localhost/odata3/v1/Site?$expand=SiteLocation,SiteLocation/SiteLocationAddress

Full Error Message
Code: Select all
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code/>
<m:message xml:lang="en-US">An error has occurred.</m:message>
<m:innererror>
<m:message>
Exception has been thrown by the target of an invocation.
</m:message>
<m:type>System.Reflection.TargetInvocationException</m:type>
<m:stacktrace>
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Http.OData.Query.ODataQueryOptions.LimitResults(IQueryable queryable, Int32 limit, Boolean& resultsLimited)
at System.Web.Http.OData.Query.ODataQueryOptions.ApplyTo(IQueryable query, ODataQuerySettings querySettings)
at System.Web.Http.OData.EnableQueryAttribute.ExecuteQuery(Object response, HttpRequestMessage request, HttpActionDescriptor actionDescriptor)
at System.Web.Http.OData.EnableQueryAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
at System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()
</m:stacktrace>
<m:internalexception>
<m:message>
An error occurred while preparing the command definition. See the inner exception for details.
</m:message>
<m:type>
System.Data.Entity.Core.EntityCommandCompilationException
</m:type>
<m:stacktrace>
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree, DbInterceptionContext interceptionContext, IDbDependencyResolver resolver, BridgeDataReaderFactory bridgeDataReaderFactory, ColumnMapFactory columnMapFactory)
at System.Data.Entity.Core.EntityClient.Internal.EntityProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.CreateCommandDefinition(ObjectContext context, DbQueryCommandTree tree)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.Prepare(ObjectContext context, DbQueryCommandTree tree, Type elementType, MergeOption mergeOption, Boolean streaming, Span span, IEnumerable`1 compiledQueryParameters, AliasGenerator aliasGenerator)
at System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Web.Http.OData.Query.TruncatedCollection`1..ctor(IQueryable`1 source, Int32 pageSize)
at System.Web.Http.OData.Query.ODataQueryOptions.LimitResults[T](IQueryable`1 queryable, Int32 limit, Boolean& resultsLimited)
</m:stacktrace>
<m:internalexception>
<m:message>
Column addition failed for symbol type 'Devart.Common.Entity.ae' and current expression 'Devart.Common.Entity.ae'.
</m:message>
<m:type>System.InvalidOperationException</m:type>
<m:stacktrace>
at Devart.Common.Entity.as.a(ds A_0, cj A_1, List`1 A_2, Dictionary`2 A_3, String& A_4)
at Devart.Common.Entity.as.a(ds A_0, ds A_1)
at Devart.Common.Entity.as.a(dm A_0, ds A_1, dd A_2, Int32 A_3)
at Devart.Common.Entity.as.a(IList`1 A_0, ew A_1, String A_2, bs A_3)
at Devart.Data.Oracle.Entity.aa.a(el A_0)
at Devart.Common.Entity.as.a(bs A_0, String A_1, bs A_2, cj& A_3)
at Devart.Common.Entity.as.a(bu A_0)
at Devart.Common.Entity.as.a(bs A_0, String A_1, bs A_2, cj& A_3)
at Devart.Common.Entity.as.a(ar A_0)
at Devart.Common.Entity.as.a(bs A_0, String A_1, bs A_2, cj& A_3)
at Devart.Common.Entity.as.a(bu A_0)
at Devart.Common.Entity.as.a(bs A_0, Boolean A_1, cj& A_2)
at Devart.Common.Entity.as.e(bs A_0)
at Devart.Data.Oracle.Entity.aa.a(e1 A_0, List`1& A_1)
at Devart.Data.Oracle.Entity.ag.a(e1 A_0, DbCommandBase A_1)
at Devart.Common.Entity.e6.c()
at Devart.Data.Oracle.Entity.OracleEntityProviderServices.CreateDbCommandDefinition(DbProviderManifest baseProviderManifest, DbCommandTree commandTree)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree, DbInterceptionContext interceptionContext, IDbDependencyResolver resolver, BridgeDataReaderFactory bridgeDataReaderFactory, ColumnMapFactory columnMapFactory)
</m:stacktrace>
</m:internalexception>
</m:internalexception>
</m:innererror>
</m:error>
jcarter
 
Posts: 3
Joined: Thu 26 Mar 2015 15:26

Re: Issue when expanding into multiple levels with OData

Postby Shalex » Fri 27 Mar 2015 14:26

Could you please send us a small test project with the corresponding DDL/DML script so that we can reproduce the issue in our environment?
Shalex
Devart Team
 
Posts: 7839
Joined: Thu 14 Aug 2008 12:44

Re: Issue when expanding into multiple levels with OData

Postby jcarter » Tue 31 Mar 2015 21:06

Thanks Shalex, I've sent in the project using the contact form.
jcarter
 
Posts: 3
Joined: Thu 26 Mar 2015 15:26

Re: Issue when expanding into multiple levels with OData

Postby Shalex » Thu 02 Apr 2015 15:09

Thank you for the test project. We have reproduced the error and are investigating the issue.
Shalex
Devart Team
 
Posts: 7839
Joined: Thu 14 Aug 2008 12:44

Re: Issue when expanding into multiple levels with OData

Postby Shalex » Thu 23 Apr 2015 13:25

The bug with generating columns in subqueries of a complex LINQ to Entities query containing limit expressions is fixed in the latest (8.4.397) build of dotConnect for Oracle.
Shalex
Devart Team
 
Posts: 7839
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle