Open DamienDoumer opened 2 years ago
On Android, you can have multiple instance of an app running and this create problem with connection=direct
. A workaround for me is that I would catch the IOException then attempt connection=shared
LiteDatabase db;
try {
db = new LiteDatabase("Filename=abc.db");
}
catch(IOException) {
db = new LiteDatabase("Filename=abc.db;Connection=shared");
}
Shared connection doesn't work everywhere. Android doesn't support it check this doc : https://www.litedb.org/docs/connection-string/
I'm having this issue on Litedb with Android app (built with xamarin forms),
Version: 5.0.11
Note:
Here is how I create the single instance of my LiteDatabase:
Here is my stacktrace:
. Can someone please help? is there a trick somewhere?