Delen via


Asynchrone beperkingen

SQLite biedt geen ondersteuning voor asynchrone I/O. Asynchrone ADO.NET methoden worden synchroon uitgevoerd in Microsoft.Data.Sqlite. Bel ze niet.

Gebruik in plaats daarvan write-ahead-logboekregistratie om de prestaties en gelijktijdigheid te verbeteren.

var connection = new SqliteConnection("Data Source=AsyncSample.db");
connection.Open();

// Enable write-ahead logging
var walCommand = connection.CreateCommand();
walCommand.CommandText =
@"
    PRAGMA journal_mode = 'wal'
";
walCommand.ExecuteNonQuery();

Tip

Logboekregistratie voor write-ahead is standaard ingeschakeld voor databases die zijn gemaakt met Entity Framework Core.