एक AccessViolationException:
System.AccessViolationException occurred
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=System.Data.SqlServerCe
StackTrace:
at System.Data.SqlServerCe.NativeMethodsHelper.OpenStore(IntPtr pOpenInfo, IntPtr pfnOnFlushFailure, IntPtr& pStoreService, IntPtr& pStoreServer, IntPtr& pQpServices, IntPtr& pSeStore, IntPtr& pTx, IntPtr& pQpDatabase, IntPtr& pQpSession, IntPtr& pStoreEvents, IntPtr& pError)
at System.Data.SqlServerCe.NativeMethods.OpenStore(IntPtr pOpenInfo, IntPtr pfnOnFlushFailure, IntPtr& pStoreService, IntPtr& pStoreServer, IntPtr& pQpServices, IntPtr& pSeStore, IntPtr& pTx, IntPtr& pQpDatabase, IntPtr& pQpSession, IntPtr& pStoreEvents, IntPtr& pError)
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at System.Data.Entity.DbContext.SaveChanges()
at SourceLog.Model.LogSubscriptionManager.<SaveChanges>b__2() in C:\github.com\tomhunter-gh\SourceLog\SourceLog.Model\LogSubscriptionManager.cs:line 51
InnerException: (null)
यहाँ कोड है कि कॉल SaveChanges()
है तब होता है जब सत्यापन योग्य प्रबंधित कोड अप्रबंधित कोड या असुरक्षित प्रबंधित कोड के साथ इंटरैक्ट करता है।
आप यह कैसे पहुँच voilation error: http://blogs.msdn.com/b/sqlservercompact/archive/2009/05/06/troubleshooting-access-violation-exception-while-using-sql-server-compact-database-with-ado-net-provider.aspx
क्या आपने कभी इस मुद्दे को हल किया है? मुझे एक समान समस्या है। –
मुझे वास्तव में मेरे उत्तर में जो कुछ है उससे बेहतर समझ नहीं मिली। आप [AddNewLogEntry] में दो संग्रहों में जोड़ा जा रहा आइटम देख सकते हैं (https://github.com/tomhunter-gh/SourceLog/blob/aed3718af18fcff471f04c83f83a0160b97b6829/SourceLog.Model/LogSubscription.cs#L90) विधि, संदर्भ में एक बार संग्रह और एक बार "यूआई संग्रह" के लिए। –
मुझे एक ही समस्या थी, यह एक पृष्ठभूमि कार्यकर्ता बन गया जो संदर्भ तक पहुंचने की कोशिश कर रहा था जबकि अन्य प्रक्रियाएं इसका उपयोग कर रही थीं। मैंने दूसरी प्रक्रियाओं के समाप्त होने के बाद उस कॉल को स्थानांतरित कर दिया और इसे हल किया। मुझे लगता है कि उन्हें कतार भी काम करेगा। जहां तक मुझे पता है कि ईएफ को थ्रेडिंग का प्रबंधन करना चाहिए, तब तक मुझे ऐसा कोई मुद्दा नहीं था जब तक कि मैंने पृष्ठभूमि कॉल नहीं बनाया। – Hannish