Skip to content

firenero/SqliteSpaceErrorRepro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

This repository contains a reproducible example of a bug in rollback handling in Microsoft.Data.Sqlite when using pattern is used for managing lifetime of SqliteTransaction.

The issue occurs for any solution that uses Microsoft.Data.Sqlite including Entity Framework Core or Dapper when the disk space is low.

Reproduction Steps

  1. Win + R to open the Run dialog, type ms-settings:storagesense to open storage settings. Disable "Storage Sense" to prevent automatic cleanup of temporary files.
  2. Adjust the Program.DatabaseFilePath constant to point to a Sqlite database file. If the file does not exist, it will be created. To speedup reproduction, it's recommended to point to a file on a disk with small empty space.
  3. Run the app and choose one of the options:
  • "1" - Uses EF Core. Catches and outputs the real error returned by SQLite.
  • "2" - Uses EF Core without catching nested "real" error. It represents the code and error handling that is common with using pattern.
  • "3" - Uses Dapper. Catches and outputs the real error returned by SQLite.
  • "4" - Uses Dapper without catching nested "real" error. It represents the code and error handling that is common with using pattern.
  1. The app will append rows to the database in loop until it runs out of disk space. Each transaction consists of 5 rows with 100 KB of data each.
  2. When the disk is full, Sqlite will throw an exception. The app will log to console the original exception and the one that's propagated from the using block.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages