ArgumentNullException when querying many fields

ArgumentNullException when querying many fields

Postby vajarov » Tue 14 Dec 2010 15:28

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.
vajarov
 
Posts: 13
Joined: Mon 19 Jul 2010 18:03

Postby AndreyR » Wed 15 Dec 2010 16:54

I have sent you a test OData solution to the e-mail you have provided in your profile.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby vajarov » Wed 15 Dec 2010 19:02

Thanks Andrey!

I am not sure when you did send the email but I have not received anything yet. Could you please resend?
vajarov
 
Posts: 13
Joined: Mon 19 Jul 2010 18:03

Postby AndreyR » Thu 16 Dec 2010 13:12

I have sent the sample once again. The first one was blocked by your mail server because of the .js files.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Thanks Andrey!

Postby vajarov » Wed 29 Dec 2010 21:29

Thanks Andrey!

I have sent a sample solution to support@devart.com that clearly illustrates the issue. Please review and advise.

G.
vajarov
 
Posts: 13
Joined: Mon 19 Jul 2010 18:03

Postby AndreyR » Mon 10 Jan 2011 17:37

Thank you for the report, we have reproduced the error.
We will let you know about the results of our investigation.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Mon 24 Jan 2011 17:36

Unfortunately, this is designed behaviour.
We are unable to change OData projection rules.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby Shalex » Wed 18 Apr 2012 17:02

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).
Shalex
Devart Team
 
Posts: 7393
Joined: Thu 14 Aug 2008 12:44

Re: ArgumentNullException when querying many fields

Postby Shalex » Thu 30 Aug 2012 16:20

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/archive/2012/08/29/wcf-data-service-5-0-2-released.aspx)

No workaround from provider's side is needed now.
Shalex
Devart Team
 
Posts: 7393
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle