diff --git a/PlexRequests.Store/Repository/BaseGenericRepository.cs b/PlexRequests.Store/Repository/BaseGenericRepository.cs index a54c2690c..e814875fa 100644 --- a/PlexRequests.Store/Repository/BaseGenericRepository.cs +++ b/PlexRequests.Store/Repository/BaseGenericRepository.cs @@ -289,9 +289,21 @@ namespace PlexRequests.Store.Repository ResetCache(); using (var db = Config.DbConnection()) { - var result = enumerable.Sum(e => db.Insert(e)); + db.Open(); + using (var tran = db.BeginTransaction()) + { + var result = enumerable.Sum(e => db.Insert(e)); + var done = result == enumerable.Length; - return result == enumerable.Length; + if (done) + { + tran.Commit(); + return true; + } + + tran.Rollback(); + return false; + } } }