- removed superfluous parameter from SerializerBase.Save()

- added "Pooling=False" parameter to all Sqlite connection strings to prevent open file locks after closing the connection and to avoid extreme delays when using CloseAllPools()
- C# code refactoring "using var" instead of "using ( ) { }" where possible
This commit is contained in:
Horst Beham
2022-11-29 22:00:16 +01:00
parent 6f3df7044e
commit d361d51b8b
57 changed files with 511 additions and 641 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Data.Sqlite;
@@ -88,7 +87,7 @@ namespace ChanSort.Loader.Android
#region Load()
public override void Load()
{
using var conn = new SqliteConnection($"Data Source={this.FileName}");
using var conn = new SqliteConnection($"Data Source={this.FileName};Pooling=False");
conn.Open();
using var cmd = conn.CreateCommand();
@@ -161,11 +160,9 @@ namespace ChanSort.Loader.Android
/// <summary>
/// The "tv.db" file was reported to exist as early as in ChannelMap_25 format and has been seen in formats 30 and 45 too
/// </summary>
public override void Save(string outputFile)
public override void Save()
{
this.FileName = outputFile;
using var conn = new SqliteConnection($"Data Source={outputFile}");
using var conn = new SqliteConnection($"Data Source={this.FileName};Pooling=False");
conn.Open();
using var trans = conn.BeginTransaction();
using var cmd = conn.CreateCommand();