The InitState method should not be called

Thread is closed for posting
3 posts, 0 answers
  1. JIG
    JIG avatar
    79 posts
    Member since:
    Sep 2009

    Posted 05 Mar 2015 Link to this post

    Anybody that has an idea what can cause this to happen? it work fine but we suddenly got this error

    Message: This InitState method should not be called.
    StackTrace:    at OpenAccessRuntime.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.InitState.copyFields(OID oid)
       at OpenAccessRuntime.DataObjects.PCStateMan.replaceApplicationPKFields()
       at OpenAccessRuntime.DataObjects.PCStateMan.setLoadRequiredIfNeededClearOrig()
       at OpenAccessRuntime.DataObjects.LocalPMCache.doMarkReloadNeeded()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.beginCommon()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.isResourceManagerEnlisted()
       at OpenAccessRuntime.DataObjects.OpenAccessQueryImp.ExecuteWithArrayImp(Int32 mode, Object[] parameters)
       at OpenAccessRuntime.QueryResultImpl.check()
       at OpenAccessRuntime.QueryResultImpl.GetEnumerator()
       at OpenAccessRuntime.QueryResultImpl.System.Collections.IEnumerable.GetEnumerator()
       at Telerik.OpenAccess.Query.ExpressionExecution.PerformDatabaseQueryMulti[T](Expression expr, ExecutionSettings settings, Object[] grpVals, Boolean checkOid, QueryOptions options)
       at Telerik.OpenAccess.Query.Piece`1.ExecuteMultiple()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at CSD4.ABI.Service.SqlWatcher.Implementation.Jobs.MF_12Close_OUT_MF_22c_OUT_Job.DoJob()
  2. JIG
    JIG avatar
    79 posts
    Member since:
    Sep 2009

    Posted 05 Mar 2015 in reply to JIG Link to this post

    I think i found the solution, I had to allow multithreading on the Model
  3. Thomas
    Thomas avatar
    590 posts

    Posted 05 Mar 2015 Link to this post

    I think you've found the right solution. Whenever a context (or its managed objects) is accessed concurrently by different threads, the multi-threaded access needs to be enabled for the model. Otherwise there is no synchronization, potentially resulting in symptoms as described by you.

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top