null oid not supported

6 posts, 0 answers
  1. Sudeep
    Sudeep avatar
    3 posts
    Member since:
    Mar 2011

    Posted 27 Jul 2011 Link to this post

    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
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 28 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. Sudeep
    Sudeep avatar
    3 posts
    Member since:
    Mar 2011

    Posted 28 Jul 2011 Link to this post

    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
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 29 Jul 2011 Link to this post

    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 >>

  6. Sudeep
    Sudeep avatar
    3 posts
    Member since:
    Mar 2011

    Posted 29 Jul 2011 Link to this post

    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
  7. Ady
    Admin
    Ady avatar
    588 posts

    Posted 02 Aug 2011 Link to this post

    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 >>

Back to Top
DevCraft banner