Hi, I'm having a problem with database access on xamarin, testing on iOS but I believe it applies cross platform.
It is very similar to the below post: http://stackoverflow.com/questions/18056166/performing-a-lot-of-sqlite-queries-in-xamarin-android-fails
I have worked through every possible scenario over the past few days to address this, in essence the code is :-
using (SqliteConnection connection = new SqliteConnection ("Data Source=" + pathToDatabaseFile)) { connection.Open (); doSomething(); connection.Close(); }
I've put this into a static class to do all my database query stuff, and as I understand it this is tight and secure (i.e. no connections left open). However, it always fails at the 'connection.Open' stage when I'm running a large number of queries. I'm totally out of ideas as to how to solve this, I'm very new to Xamarin but have released apps which are using this code which work fine, its only once the number of queries (I assume) goes over a certain point.
I've looked into singleton design patterns but can't find any explicit samples of one for database access, can anyone please help as I'm totally at a loss as to how to fix this.
Thanks John