SQL Server Compact Edition 4 - AccessViolationException
问题 I'm building a .NET 4 WPF application using Entity Framework code first and SQL Server Compact 4.0. I'm trying to call DbContext.SaveChanges() on a background thread to avoid blocking the UI, but I'm occasionally getting the following exception: 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