Skip to content

Commit ef71f49

Browse files
authored
set dbrmap non-static on Android
1 say there are multiple instances of SQLPlugin.java, at some point one instance got disposed(removed the runner from the dbrmap and closed the database), the other instances could get affected, getting the database-not-open error especially if the dispose behavior comes after than the other instances working on the database. 2 the backgroundExecuteSqlBatch call in the js file did not pass in an error callback when calling the native side, thus the database-closed message got lost entirely.
1 parent 67b56d6 commit ef71f49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/android/io/sqlc/SQLitePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class SQLitePlugin extends CordovaPlugin {
4444
* THANKS to @NeoLSN (Jason Yang/楊朝傑) for giving the pointer in:
4545
* https://github.com/litehelpers/Cordova-sqlite-storage/issues/727
4646
*/
47-
static Map<String, DBRunner> dbrmap = new ConcurrentHashMap<String, DBRunner>();
47+
Map<String, DBRunner> dbrmap = new ConcurrentHashMap<String, DBRunner>();
4848

4949
/**
5050
* NOTE: Using default constructor, no explicit constructor.

0 commit comments

Comments
 (0)