I am having intermitent exceptions when writing or reading from a Sqlite database. It happens both in memory and in physical databases that are created at runtime.
It seems like a race condition. I managed to create a simple repo to reproduce the problem.
See this repo at this commit to find details and reproduce it. It's simply a class library with sqlite-net-pcl dependency and a xUnit integration tests project.
If you clone the repo and run the tests you'll see that most likely all of them will fail. If you run one by one they wil succeed
I don't know whether it has something to do with the way the tables are created (I reproduced it the same way as I have it in my Xamarin.Forms application where the initialization happens in a synchronous context when Android runs).
The tests simply write a row and read it to make assertions.
Any advice on whether this is a bug or a bad practice on my side would be much appreciated.
I am having intermitent exceptions when writing or reading from a Sqlite database. It happens both in memory and in physical databases that are created at runtime.
It seems like a race condition. I managed to create a simple repo to reproduce the problem. See this repo at this commit to find details and reproduce it. It's simply a class library with
sqlite-net-pcl
dependency and a xUnit integration tests project.If you clone the repo and run the tests you'll see that most likely all of them will fail. If you run one by one they wil succeed
I don't know whether it has something to do with the way the tables are created (I reproduced it the same way as I have it in my Xamarin.Forms application where the initialization happens in a synchronous context when Android runs).
The tests simply write a row and read it to make assertions.
Any advice on whether this is a bug or a bad practice on my side would be much appreciated.