public void InsertOrReplaceAllWithChildren(System.Collections.IEnumerable collection) { //using (SQLiteConnection _dbManager = new SQLiteConnection(_baseUrl.GetDatabasePath(), WriteOnlyFlags)) using (SQLiteConnectionWithLock _dbManager = new SQLiteConnectionWithLock(new SQLiteConnectionString(_baseUrl.GetDatabasePath(), false, null), SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create | SQLiteOpenFlags.FullMutex | SQLiteOpenFlags.SharedCache)) { using (_dbManager.Lock()) { try { _dbManager.InsertOrReplaceAllWithChildren(collection, true); } catch (Exception ex) { Debug.WriteLine($"SQLiteError: {ex.Message}"); } } } }