Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Sqlite best practice - single DB connection for app or open/close connection for each operation?

$
0
0

Hi,
I've seen various coding samples where people either open and hold a SqliteConnection for the life of the app and others were the SqliteConnection is opened and closed. The Sqlite documentation indicates that there is a SERIALIZED threading mode that makes sharing a connection between threads safe.
Does anyone have experience using that in Xamarin Forms? I'll have background threads updating the database at the same time as the UI threads.
Should I obtain SqliteConnection and open/close it with every operation or leave the SqliteConnection open the life of the app?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>