Page 1 of 1

ArgumentNullException when querying many fields

Posted: Tue 14 Dec 2010 15:28
by vajarov
Here is my scenario:

I have built a WCF Data (oData) service that is using dotConnect for Ora provider, version 5.70.190.0. When I execute a query to a single entity, selecting up to 8 properties, all is well. However, if I add just one more property/column to the list of selects I get the following exception (the type of the newly added property does not seem to make any difference) :

ArgumentNullException: Value cannot be null.Parameter name: value

and here is the stack trace:

at System.Data.Services.WebUtil.CheckArgumentNull[T](T value, String parameterName)
at System.Data.Services.Internal.ProjectedWrapper.set_PropertyNameList(String value)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Data.Services.Internal.ProjectedWrapper.EnumeratorWrapper.MoveNext()
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService)
at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)
at System.Data.Services.DataService`1.HandleRequest()

I saw forums that mention similar problems, but it was recommended that the users upgrade and I am already using the latest version of the dotConnect for Ora.

Does anyone have any idea where I need to look at?
Is this a known issue?

It appears that the length of the URL is in play here - if I have it under around 180 characters it works, if it is higher than that, not so much.

Many thanks in advance, G.

Posted: Wed 15 Dec 2010 16:54
by AndreyR
I have sent you a test OData solution to the e-mail you have provided in your profile.

Posted: Wed 15 Dec 2010 19:02
by vajarov
Thanks Andrey!

I am not sure when you did send the email but I have not received anything yet. Could you please resend?

Posted: Thu 16 Dec 2010 13:12
by AndreyR
I have sent the sample once again. The first one was blocked by your mail server because of the .js files.

Thanks Andrey!

Posted: Wed 29 Dec 2010 21:29
by vajarov
Thanks Andrey!

I have sent a sample solution to [email protected] that clearly illustrates the issue. Please review and advise.

G.

Posted: Mon 10 Jan 2011 17:37
by AndreyR
Thank you for the report, we have reproduced the error.
We will let you know about the results of our investigation.

Posted: Mon 24 Jan 2011 17:36
by AndreyR
Unfortunately, this is designed behaviour.
We are unable to change OData projection rules.

Posted: Wed 18 Apr 2012 17:02
by Shalex
Please put the following line in the constructor of your context (the Devart.Data.Oracle.Entity.OracleEntityProviderServices class is defined in the %ProgramFiles%\Devart\dotConnect\Oracle\Entity\EF4\Devart.Data.Oracle.Entity.dll assembly):

Code: Select all

Devart.Data.Oracle.Entity.OracleEntityProviderServices.HandleNullStringsAsEmptyStrings = true;
Refer to http://blogs.planetsoftware.com.au/paul ... d-wcf.aspx . This is actually the problem of WCF Data Services which doesn't take into account the peculiarities of other RDMS (Oracle treats empty strings in varchar columns as null).

Re: ArgumentNullException when querying many fields

Posted: Thu 30 Aug 2012 16:20
by Shalex
This problem was solved in WCF Data Service 5.0.2: "Fixes a bug where projections involving more than eight columns would fail if the EF Oracle provider was being used" (http://blogs.msdn.com/b/astoriateam/arc ... eased.aspx)

No workaround from provider's side is needed now.