This is a migrated thread and some comments may be shown as answers.

null oid not supported

5 Answers 306 Views
OQL (OQL specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sudeep
Top achievements
Rank 1
Sudeep asked on 27 Jul 2011, 11:44 PM
I am using ORM and querying an entity.
I am getting this error "null oid not supported" for some specific records.
However there does not seem to be anything different with these records.
Your early response would be appreciated.

Thanks,
Sudeep

5 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 28 Jul 2011, 08:20 AM
Hi Sudeep,
It looks like there is an object where the id field contains a null. When do you get this exception? Is it during context.Add()?

Kind regards,
Jan Blessenohl
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Sudeep
Top achievements
Rank 1
answered on 28 Jul 2011, 04:15 PM
Hi Jan,

Yes you are correct.
There is this entity having two fields set as Identity field.
One of the fields is purely unique (set a Primary Key in DB)  where as the other one is not so.
I am getting this error while fetching the records having the second key field as null.
Just to mention I am using the first key only in lamda expression.

Thanks,
Sudeep Kukreti
0
Jan Blessenohl
Telerik team
answered on 29 Jul 2011, 12:30 PM
Hello Sudeep,
I have tried to reproduce it, but without luck. Can you catch the exception and send me the exception.ToString() output?

Kind regards,
Jan Blessenohl
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Sudeep
Top achievements
Rank 1
answered on 29 Jul 2011, 04:32 PM
hI Jan,

As mentioned I know the exception is getting generated when one of the identity keys (from combination key [2]) is null, but not sure if it is by design and if yes then does there exist any workaround for it.

The exception string generated is as below:
Telerik.OpenAccess.Exceptions.DataStoreException: System.ArgumentException: null oid not supported
   at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
   at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
   at OpenAccessRuntime.common.StatesReturned.addImp(OID oid, State state, Boolean directFlag)
   at OpenAccessRuntime.common.StatesReturned.add(OID key, State value_Renamed)
   at OpenAccessRuntime.Relational.RelationalQueryResult.fetchManagedTypes(ApplicationContext context, Int32 fetchAmount, QueryResultContainer results)
   at OpenAccessRuntime.Relational.RelationalQueryResult.fetchNextResultBatch(ApplicationContext context, QueryResultContainer results, Int32 fetchAmount)  ---> System.ArgumentException: null oid not supported
   at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
   at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
   at OpenAccessRuntime.common.StatesReturned.addImp(OID oid, State state, Boolean directFlag)
   at OpenAccessRuntime.common.StatesReturned.add(OID key, State value_Renamed)
   at OpenAccessRuntime.Relational.RelationalQueryResult.fetchManagedTypes(ApplicationContext context, Int32 fetchAmount, QueryResultContainer results)
   at OpenAccessRuntime.Relational.RelationalQueryResult.fetchNextResultBatch(ApplicationContext context, QueryResultContainer results, Int32 fetchAmount)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
   at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
   at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.executeQueryAll(ApplicationContext context, ImmutableQueryDetails query, CompiledQuery compiledQuery, QueryParameters parameters, Int32 skip, Int32 take)
   at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getAllQueryResults(CompiledQuery cq, QueryParameters parameters, Int32 skip, Int32 take)
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.Resolve()
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize(Int32 indexParam)
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam)
   at Telerik.OpenAccess.RT.ListEnumerator.setCurrent(Int32 _pos)
   at Telerik.OpenAccess.RT.ListEnumerator.Move(Int32 relative)
   at Telerik.OpenAccess.RT.ListEnumerator.MoveNext()
   at Telerik.OpenAccess.Query.ExpressionExecution.PerformDatabaseQuerySingle[TResult,T](Piece`1 piece, Int32& found, Int32 elemAt, Boolean single)
   at Telerik.OpenAccess.Query.ExpressionExecution.PerformQuerySingle[T,TResult](Piece`1 piece, Expression expression)
   at Telerik.OpenAccess.Query.Piece`1.System.Linq.IQueryProvider.Execute[TResult](Expression expr)
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
   at Nabors.AdminScreens.DataLayer.DrillDownDAL.getAttributeDetails(Int64 DatamartId, Int64 AttributeId, String& errMsg) in C:\TFS\COMMONADMIN - DEV\SOURCE\AdminScreens\Nabors.AdminScreens.DataLayer\DrillDownDAL.cs:line 316

Thanks,
Sudeep Kukreti
0
Ady
Telerik team
answered on 02 Aug 2011, 03:57 PM
Hello Sudeep,

 I'm afraid we do not support 'null' values as part of the identity. Each member that makes up the identity of a class must have a non-null value. There is no workaround either to this problem.

Why have you marked the other field (with null values) as an identity field? As I understand it is not a part of the PK on the database. Am I right?

Regards,
Ady
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
OQL (OQL specific questions)
Asked by
Sudeep
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Sudeep
Top achievements
Rank 1
Ady
Telerik team
Share this question
or