You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need db sharing between my custom Java code (service) and this plugin (CordovaJS) similar as in #309. I have a single global static SQLiteOpenHelper instance which keeps its "static SQLiteDatabase db" variable. However I sometimes get following error when my Java code tries to access db:
W/SQLiteConnectionPool: The connection pool for database XXX has been unable to grant a connection to thread 2 (main) with flags 0x6 for 8.002001 seconds.
Connections: 0 active, 1 idle, 0 available.
I think I handle all my custom Java db transactions properly, using this scheme:
Thanks for reply. I forgot to mention that my app then stops responding completely (permanent ANR) and I repeatedly get the SQLiteConnectionPool warning above only with increasing timeout time - it will remain in ANR for many hours (easily several 10k of seconds). This is a big pain in the ass for me. I have to manually kill the app to make it run again.
I try to use the singleton approach for SQLite (like described here: https://www.androiddesignpatterns.com/2012/05/correctly-managing-your-sqlite-database.html) but I have a problem that I extend my SQLiteHepler with various different code for various apps so I do not have "synchronized" getInstance method like in the example but rather check the global variable which holds my SQLiteOpenHelper instance for null and if equals null then I create new SQLiteOpenHelper instance.
In the meantime I solved the problem by not accessing the DB from my Java code and only using your plugin. But this is not ideal for me...
I need db sharing between my custom Java code (service) and this plugin (CordovaJS) similar as in #309. I have a single global static SQLiteOpenHelper instance which keeps its "static SQLiteDatabase db" variable. However I sometimes get following error when my Java code tries to access db:
I think I handle all my custom Java db transactions properly, using this scheme:
In the constructor of my SQLiteOpenHelper class I do "db = this.getWritableDatabase();"
I tried to patch plugin Java code with proper transaction handling (begin, end etc.) but that did not help. The code is here (version 3.2.0):
https://drive.google.com/file/d/13GWVYVRqY9jE5jHV2geL05pbqE1iLe7p
Can you help me please?
The text was updated successfully, but these errors were encountered: