Hello,
Using the latest 2.50.X version of LinqConnect and in a heavy duty environment, i occasionally get a weird exception during a call to a LINQ to SQL statement:
System.ArgumentException: The method 'Exis.eXray.Domain.ExrayDataContext.get_UdfsValues' is not a property accessor
at System.Linq.Expressions.Expression.GetProperty(MethodInfo mi)
at System.Linq.Expressions.Expression.Property(Expression expression, MethodInfo propertyAccessor)
Of course, the property is right over there and used in the same system in 1000's of places! It is rather unusual and rare. So, is there maybe an internal cache of MethodInfos that you keep for performance reasons, that maybe for some reason is cleared or not properly synchronized, that results to a small time window where this property is requested but not present? Could there be something in my code that invalidates this cache?
Property accessor, randomly, not found
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Next line on stack trace is my LINQ to SQL query that uses this table. Same line is executed successfully in 1000 times and in 1 of them, i get this error.
Query is the following:
var invoices = from objInvoice in context.Invoices
where objInvoice.CuId == anonmeter.CustomerId
&& objInvoice.AffBal == "1"
&& (from objUdfValue in context.UdfsValues
where objUdfValue.UdfId == InvoiceSupplyNoUDFId
&& objUdfValue.Value.Substring(0, 4000) == anonmeter.Meter
select objUdfValue.RefId).Contains(
objInvoice.Id)
select new
{
TransactionValue = objInvoice.TotalCharge,
TransactionDate = objInvoice.Date,
TransactionType = TransactionTypeEnum.Invoice,
TransactionDueDate = objInvoice.DueDate.Value
};
This is enclosed in a function and in a foreach statement and therefore called hundreds of times. In maybe 100 calls of this function that calls 1000 times this LINQ to SQL, i get 1 that gives the error.
Query is the following:
var invoices = from objInvoice in context.Invoices
where objInvoice.CuId == anonmeter.CustomerId
&& objInvoice.AffBal == "1"
&& (from objUdfValue in context.UdfsValues
where objUdfValue.UdfId == InvoiceSupplyNoUDFId
&& objUdfValue.Value.Substring(0, 4000) == anonmeter.Meter
select objUdfValue.RefId).Contains(
objInvoice.Id)
select new
{
TransactionValue = objInvoice.TotalCharge,
TransactionDate = objInvoice.Date,
TransactionType = TransactionTypeEnum.Invoice,
TransactionDueDate = objInvoice.DueDate.Value
};
This is enclosed in a function and in a foreach statement and therefore called hundreds of times. In maybe 100 calls of this function that calls 1000 times this LINQ to SQL, i get 1 that gives the error.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
According to the stack trace, the issue occurs when .NET Framework creates an expression based on your LINQ query. This is a step not controlled by LinqConnect (the latter only processes the expressions prepared by .NET Framework). Thus, the issue you are observing apparently is related to .NET Framework itself.