1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Add proper transaction rollback logic on exception

This commit is contained in:
Dean Herbert 2018-05-28 18:38:42 +09:00
parent f6f18e2fe2
commit 2a87b851fa

View File

@ -28,9 +28,20 @@ namespace osu.Game.Database
if (isDisposed) return;
isDisposed = true;
try
{
PerformedWrite |= Context.SaveChanges(transaction) > 0;
}
catch (Exception e)
{
transaction?.Rollback();
throw;
}
finally
{
usageCompleted?.Invoke(this);
}
}
public void Dispose()
{