Exception when creating list/array from IQueryAble

Exception when creating list/array from IQueryAble

Postby jsc003 » Wed 13 Apr 2016 08:16

I get an exception when trying to create a list/array from a IQueryAble resultset using dotconnect.

Sourcecode:

var result = entities.SLCAVEs.Where(t => t.PERSONID.HasValue && t.PERSONID.Value.Equals(personId));
Console.WriteLine(result.Count());
var list = result.ToArray();

The result-object contains 28 elements.

Stacktrace:
Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
at Devart.Data.Oracle.ag.aa(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Common.l.aq(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Common.l.b(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.Oracle.ag.b(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.Oracle.OracleDataReader.GetInt32(Int32 i)
at Devart.Data.Oracle.Entity.ai.b(Int32 A_0)
at Devart.Common.Entity.cd.GetValue(Int32 ordinal)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetUntypedValueDefault(DbDataReader reader, Int32 ordinal)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at lambda_method(Closure , Shaper )
at System.Data.Entity.Core.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
jsc003
 
Posts: 1
Joined: Wed 13 Apr 2016 07:47

Re: Exception when creating list/array from IQueryAble

Postby Shalex » Thu 14 Apr 2016 13:02

Please send us a small complete test project with the corresponding DDL/DML script for reproducing the issue. In case of >2MB attachment, we recommend either using some file exchange server (send us the corresponding link) or uploading a test project to our FTP server (the credentials will be provided by email request).
Shalex
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44

Re: Exception when creating list/array from IQueryAble

Postby dcoracle600pro » Mon 28 Nov 2016 14:23

Please, I have the same problem in my application.
I'am working with : Devart.Data (5.0.1408.0), Devart.Data.Linq (4.5.954.0), Devart.Data.Oracle(8.5.616.0), Devart.Data.Oracle.Entity (8.5.616.6), Devart.Data.Oracle.Linq (4.5.954.0).

Sometimes, it's occurred when I executed a LinqToOracle request into an IQueryable, and just after that, I want to use this IQueryable by doing a LinqToObject request.
At the end, I launch a IQueryable.ToList() I have this exception :

à System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
à System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
à System.Decimal.Parse(String s, IFormatProvider provider)
à Devart.Data.Oracle.ag.ab(Byte[] A_0, Int32 A_1, Int32 A_2)
à Devart.Common.l.j(Byte[] A_0, Int32 A_1, Int32 A_2)
à Devart.Data.Oracle.ag.j(Byte[] A_0, Int32 A_1, Int32 A_2)
à Devart.Data.Oracle.OracleDataReader.GetDecimal(Int32 i)
à MaterializeLgnColise(MaterializerScope )
à Devart.Data.Linq.Engine.ObjectReader`1.a()
à Devart.Data.Linq.Engine.ObjectReader`1.a(T& A_0)
à Devart.Data.Linq.Engine.ObjectReader`1.c()
à System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
à System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
dcoracle600pro
 
Posts: 43
Joined: Mon 09 Apr 2012 09:57

Re: Exception when creating list/array from IQueryAble

Postby Shalex » Tue 29 Nov 2016 14:57

Please try to localize the issue and send us a small complete test project with the corresponding DDL/DML script for reproducing the issue.

In case of >2MB attachment, we recommend either using some file exchange server (send us the corresponding link) or uploading a test project to our FTP server (the credentials will be provided by email request).
Shalex
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44

Re: Exception when creating list/array from IQueryAble

Postby dcoracle600pro » Thu 06 Jul 2017 10:06

I think the bug is solved in 9.4 :
LinqConnect support
The bug with running LINQ queries, which invoke .NET methods on client side during materialization of result set, is fixed
The bug with materializing scalar value collection when converting values on the client side is fixed


I have upgraded my application with 9.4 and I cannot reproduce the problem.
dcoracle600pro
 
Posts: 43
Joined: Mon 09 Apr 2012 09:57

Re: Exception when creating list/array from IQueryAble

Postby Shalex » Thu 06 Jul 2017 10:55

Thank you for confirming the fix.
Shalex
Devart Team
 
Posts: 7608
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle