Pragmas that change the safety level of a connection cannot be performed within a transaction

This commit is contained in:
Carl Johnsen
2025-06-11 09:01:12 +02:00
parent 51b86b06ff
commit ebdddebeb1
@@ -147,9 +147,7 @@ namespace Duplicati.Library.SQLiteHelper
return con;
using (var cmd = con.CreateCommand())
using (var transaction = con.BeginTransaction(deferred: true))
{
cmd.Transaction = transaction;
foreach (var opt in opts.Split([';'], StringSplitOptions.RemoveEmptyEntries))
{
Logging.Log.WriteVerboseMessage(LOGTAG, "CustomSQLiteOption", @"Setting custom SQLite option '{0}'.", opt);
@@ -163,7 +161,6 @@ namespace Duplicati.Library.SQLiteHelper
Logging.Log.WriteWarningMessage(LOGTAG, "CustomSQLiteOption", ex, @"Error setting custom SQLite option '{0}'.", opt);
}
}
await transaction.CommitAsync();
}
return con;
}