Skip to content

Commit

Permalink
set dbrmap non-static on Android
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SigmaQ authored Mar 15, 2018
1 parent 67b56d6 commit ef71f49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/android/io/sqlc/SQLitePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SQLitePlugin extends CordovaPlugin {
* THANKS to @NeoLSN (Jason Yang/楊朝傑) for giving the pointer in:
* https://github.com/litehelpers/Cordova-sqlite-storage/issues/727
*/
static Map<String, DBRunner> dbrmap = new ConcurrentHashMap<String, DBRunner>();
Map<String, DBRunner> dbrmap = new ConcurrentHashMap<String, DBRunner>();

/**
* NOTE: Using default constructor, no explicit constructor.
Expand Down

0 comments on commit ef71f49

Please sign in to comment.