Jasonnn
Threading and Microsoft.Data.Sqlite
Ah I see
Edit: but it says « By default, Lazy<T> objects are thread-safe. That is, if the constructor does not specify the kind of thread safety, the Lazy<T> objects it creates are thread-safe. In multi-threaded scenarios, the first thread to access the Value property of a thread-safe Lazy<T> object initializes it for all subsequent accesses on all threads, and all threads share the same data. » in the documentation
25 replies
Threading and Microsoft.Data.Sqlite
If I do:
as a local variable in
public static void QueryDatabase()
then I don't have any problems anymore (but then I'm opening 100 different connections!)
Which is why I'm pretty much convinced the problem comes from the fact that all my threads are using the same object.25 replies