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

The InitState method should not be called

2 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JIG
Top achievements
Rank 1
JIG asked on 05 Mar 2015, 08:26 AM
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 Answers, 1 is accepted

Sort by
0
JIG
Top achievements
Rank 1
answered on 05 Mar 2015, 08:55 AM
I think i found the solution, I had to allow multithreading on the Model
0
Thomas
Telerik team
answered on 05 Mar 2015, 11:41 AM
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.

Regards,
Thomas
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
General Discussions
Asked by
JIG
Top achievements
Rank 1
Answers by
JIG
Top achievements
Rank 1
Thomas
Telerik team
Share this question
or