Compiled Query Exception

Compiled Query Exception

Postby basem » Thu 03 Mar 2011 05:38

I'm getting an InvalidOperationException was unhandled by user code with a compiled query, 'Could not format node 'ClientParameter' for execution as SQL.'. The iiner exception is null. The exception detail is the following:

System.InvalidOperationException was unhandled by user code
Message="Could not format node 'ClientParameter' for execution as SQL."
Source="Devart.Data.Linq"
StackTrace:

at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitWithParens(SqlNode node, SqlNode outer)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitBinaryOperator(ad bo)
at Devart.Data.Linq.Provider.Query.SqlVisitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitWithParens(SqlNode node, SqlNode outer)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitBinaryOperator(ad bo)
at Devart.Data.Linq.Provider.Query.SqlVisitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitSelect(v ss)
at Devart.Data.Linq.Provider.Query.SqlVisitor.VisitAlias(d a)
at Devart.Data.Linq.Provider.Query.SqlVisitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitSelect(v ss)
at Devart.Data.Linq.Provider.Query.SqlVisitor.VisitAlias(d a)
at Devart.Data.Linq.Provider.Query.SqlVisitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlVisitor.VisitIncludeScope(al node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.VisitIncludeScope(al node)
at Devart.Data.Linq.Provider.Query.SqlVisitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Visitor.Visit(SqlNode node)
at Devart.Data.Linq.Provider.Query.SqlFormatter.Format(SqlNode node, CommandType& commandType)
at Devart.Data.Linq.Provider.DataProvider.BuildQuery(ResultShape resultShape, Type resultType, SqlNode node, IList`1 externalParameterAccessors)
at Devart.Data.Linq.Provider.DataProvider.BuildQuery(Expression query)
at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Compile(Expression query)
at Devart.Data.Linq.CompiledQuery.a(b A_0)
at Devart.Data.Linq.CompiledQuery.a(DataContext A_0, Object[] A_1)
at Devart.Data.Linq.CompiledQuery.Invoke[a,b,c,d](a A_0, b A_1, c A_2)
at DiPSM_RMF_LIB.DiPSM_RMF_LIB.DAL.Repositories.ActivityRepository.GetActivityTimeslots(Guid ACTIVITY_ID, Int32 WEEK_ID) in D:\Projects\DiPSM\DEV\Active\UWS.DiPSM_20110131_ProductionMaintenance\UWS.DiPSM.RMF\DiPSM_RMF_LIB\DAL\Repositories\ActivityRepository.vb:line 228
at DiPSM_RMF_LIB.DiPSM_RMF_LIB.BLL.Managers.ActivityManager.GetActivityTimeslots(Guid ActivityID, Int32 WeekID) in D:\Projects\DiPSM\DEV\Active\UWS.DiPSM_20110131_ProductionMaintenance\UWS.DiPSM.RMF\DiPSM_RMF_LIB\BLL\Managers\ActivityManager.vb:line 436
at DiPSM_RMF_WEB.LocationsTimeslots.LoadActivityTimeSlots(Guid ActivityID) in D:\Projects\DiPSM\DEV\Active\UWS.DiPSM_20110131_ProductionMaintenance\UWS.DiPSM.RMF\DiPSM_RMF_WEB\_Shares\LocationsTimeslots.ascx.vb:line 346
at DiPSM_RMF_WEB.LocationsTimeslots.GetAvailabilityWeekTimeslots() in D:\Projects\DiPSM\DEV\Active\UWS.DiPSM_20110131_ProductionMaintenance\UWS.DiPSM.RMF\DiPSM_RMF_WEB\_Shares\LocationsTimeslots.ascx.vb:line 590
at DiPSM_RMF_WEB.LocationsTimeslots.GetWeekTimeslots() in D:\Projects\DiPSM\DEV\Active\UWS.DiPSM_20110131_ProductionMaintenance\UWS.DiPSM.RMF\DiPSM_RMF_WEB\_Shares\LocationsTimeslots.ascx.vb:line 561
at DiPSM_RMF_WEB.LocationsTimeslots.Page_Load(Object sender, EventArgs e) in D:\Projects\DiPSM\DEV\Active\UWS.DiPSM_20110131_ProductionMaintenance\UWS.DiPSM.RMF\DiPSM_RMF_WEB\_Shares\LocationsTimeslots.ascx.vb:line 47


I use a Guid and Decimal as input to the query ...

Public Shared ReadOnly Property GetActivityTimeslots2() As Func(Of DiPSMDataContext, Guid, Decimal, IQueryable(Of ActivityCell))
Get
Dim func As Func(Of DiPSMDataContext, System.Guid, Decimal, IQueryable(Of ActivityCell)) = _
CompiledQuery.Compile(Of DiPSMDataContext, Guid, Decimal, IQueryable(Of ActivityCell))(Function(_db As DiPSMDataContext, ACTIVITY_ID As Guid, WEEK_ID As Decimal) _
From a In _db.ACTIVITies _
Join ats In _db.ACTIVITY_TIMESLOTs On a.ACTIVITY_ID Equals ats.ACTIVITY_ID _
Join ttc In _db.TIME_TABLE_CELLs On ats.TIME_TABLE_CELL_ID Equals ttc.TIME_TABLE_CELL_ID _
Group Join serv In _db.ALLOCATED_SERVICEs On ats.ACTIVITY_ID Equals serv.ACTIVITY_ID And ats.TIME_TABLE_CELL_ID Equals serv.TIME_TABLE_CELL_ID Into ga = Group From serv In ga.DefaultIfEmpty _
Where a.ACTIVITY_ID = ACTIVITY_ID AndAlso ttc.WEEK_ID = WEEK_ID _
Order By a.ACTIVITY_NAME _
Group ttc By key = a.ACTIVITY_ID, a.ACTIVITY_NAME, ttc.DAY_ID, serv.ESS_ID, serv.SERVICE_PROVIDER_ID Into MinTimeID = Min(ttc.TIME_ID), TimeSlotsCount = Count() _
Select New ActivityCell() With { _
.ACTIVITY_ID = ACTIVITY_ID, _
.ACTIVITY_NAME = ACTIVITY_NAME, _
.DAY_ID = DAY_ID, _
.TIME_ID = MinTimeID, _
.TimeSlotsCount = TimeSlotsCount, _
.ESS_ID = ESS_ID, _
.SERVICE_PROVIDER_ID = SERVICE_PROVIDER_ID _
})
Return func
End Get
End Property
basem
 
Posts: 2
Joined: Tue 27 Jul 2010 04:03

Postby StanislavK » Thu 03 Mar 2011 11:39

Thank you for your report, we've reproduced the problem. We will analyze it and inform you about the results as soon as possible.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby StanislavK » Thu 24 Mar 2011 14:46

We have released the new 6.10.126 build of dotConnect for Oracle where this issue is fixed. The new build can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only):
http://secure.devart.com/

For more information about the fixes and improvements available in dotConnect for Oracle 6.10.126, please refer to
http://www.devart.com/forums/viewtopic.php?t=20584
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for Oracle