This project is read-only.

Unable to open and close database

Oct 26, 2011 at 11:26 AM


I'm trying to use your API for SQLite for metro application and have discovered that it does not support multithreading. (COM exception occuors)
A workaround was to open and than close database within same thread which worked if GC managed to collect database in time.


Database db = OpenDatabase();
// do stuff


However this method is very unreliable and unsebla in most of scenarios.
Is there a way to make it work with the new async/await keywords from .NET 4.5 in a reliable way?
Is there a way to delete a database?

Oct 28, 2011 at 5:08 PM

You should use using in C# (using (var db = ...)). This will call the destructor which will close the sqlite instance.