V11: Use SqLiteException instead of SqlException in SqliteDistributedLockingMechanism & fix E2E tests (#13293)

This commit is contained in:
Mole
2022-10-25 16:40:36 +02:00
committed by GitHub
parent 9e3178034e
commit fc187596e3
2 changed files with 972 additions and 6 deletions

View File

@@ -1,7 +1,6 @@
using System.Data;
using System.Data.Common;
using System.Globalization;
using Microsoft.Data.SqlClient;
using Microsoft.Data.Sqlite;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
@@ -84,7 +83,7 @@ public class SqliteDistributedLockingMechanism : IDistributedLockingMechanism
throw new ArgumentOutOfRangeException(nameof(lockType), lockType, @"Unsupported lockType");
}
}
catch (SqlException ex) when (ex.Number == 1222)
catch (SqliteException ex) when (ex.SqliteErrorCode == SQLitePCL.raw.SQLITE_BUSY)
{
if (LockType == DistributedLockType.ReadLock)
{