diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs index 2df377cbce..60c3c1fe02 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteDisplayPreferencesRepository.cs @@ -148,6 +148,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -157,6 +159,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs index 33e9c7fe37..a0acd523ea 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteItemRepository.cs @@ -236,15 +236,19 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { - Logger.ErrorException("Failed to save item:", e); + Logger.ErrorException("Failed to save items:", e); if (transaction != null) { transaction.Rollback(); } + + throw; } finally { @@ -439,15 +443,19 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { - Logger.ErrorException("Failed to save item:", e); + Logger.ErrorException("Failed to save children:", e); if (transaction != null) { transaction.Rollback(); } + + throw; } finally { diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs index ee2fcc10cf..7547212c5c 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs @@ -151,38 +151,6 @@ namespace MediaBrowser.Server.Implementations.Sqlite } } - /// - /// Executes the command. - /// - /// The CMD. - /// Task. - /// cmd - public async Task ExecuteCommand(DbCommand cmd) - { - if (cmd == null) - { - throw new ArgumentNullException("cmd"); - } - - using (var tran = Connection.BeginTransaction()) - { - try - { - cmd.Connection = Connection; - cmd.Transaction = tran; - - await cmd.ExecuteNonQueryAsync().ConfigureAwait(false); - - tran.Commit(); - } - catch (Exception e) - { - Logger.ErrorException("Failed to commit transaction.", e); - tran.Rollback(); - } - } - } - /// /// Gets a stream from a DataReader at a given ordinal /// diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs index 284ef10fb3..d378809ffb 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs @@ -203,6 +203,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -212,6 +214,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs index df0d13b623..335841549a 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserRepository.cs @@ -145,6 +145,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -154,6 +156,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally { @@ -228,7 +232,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite cmd.Transaction = transaction; - await ExecuteCommand(cmd).ConfigureAwait(false); + await cmd.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false); } transaction.Commit(); @@ -239,6 +243,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } catch (Exception e) { @@ -248,6 +254,8 @@ namespace MediaBrowser.Server.Implementations.Sqlite { transaction.Rollback(); } + + throw; } finally {