I'm using SQLite in Windows from a .NET app. The .NET app is using the Open Source System.Data.SQLite library.
In my app, there are many threads accessing the same database. Is it best to:
- Create and destroy connections as needed (what's the maximum number I can have?)
- Create a long lived connection and use it from different threads (is this safe?)
- Something else?
I initially went with choice# 2 but got random/intermittent errors relating to transactions when accessing the connection from other threads. I've since moved to choice# 1 and there error has gone.