C#C
C#12mo ago
16 replies
reeeeeee

SQLite weird state managing / caching

I am working on .NET API and I have some problems with handling/saving sqlite state. Before I post all of my code, I am using EF and handling dbcontext lifecycle with DI.
What is the process where the problems occur:
- Start API and send one POST requet to enter something in DB (when the API is starter, sqlite created WAL and SHM files)
- The entered data is visible on API website and always in DB Browser for Sqlite
- Stop API
- Data still visible in DB Browser. I can also close the browser and open it again, and the data is still there
- When I start the API again, the data dissapears. Its not visible in DB Browser, as well as in API website.
*Closing DB browser clears .WAL and .SHM files, stopping API doesnt

Any idea where the problem might be? Which part of the workflow?
Was this page helpful?