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
Copy file name to clipboardExpand all lines: README.md
+17-1
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,16 @@ _XXX TBD ???:_
20
20
21
21
<!-- END About this version branch -->
22
22
23
+
## WARNING: Multiple SQLite problem on Android
24
+
25
+
This plugin uses a non-standard [Android-sqlite-connector](https://github.com/liteglue/Android-sqlite-connector) implementation on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in <http://ericsink.com/entries/multiple_sqlite_problem.html> and <https://www.sqlite.org/howtocorrupt.html>.
26
+
27
+
The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below:
28
+
29
+
```js
30
+
var db =window.sqlitePlugin.openDatabase({name:"my.db", androidDatabaseImplementation:2});
31
+
```
32
+
23
33
## BREAKING CHANGE: Database location parameter is now mandatory
24
34
25
35
The `location` or `iosDatabaseLocation`*must* be specified in the `openDatabase` and `deleteDatabase` calls, as documented below.
@@ -362,6 +372,8 @@ var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'},
362
372
363
373
**WARNING:** The new "default" location value is *NOT* the same as the old default location and would break an upgrade for an app that was using the old default value (0) on iOS.
364
374
375
+
**WARNING 2:** As described above: by default this plugin uses a non-standard [Android-sqlite-connector](https://github.com/liteglue/Android-sqlite-connector) implementation on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in <http://ericsink.com/entries/multiple_sqlite_problem.html> and <https://www.sqlite.org/howtocorrupt.html>. The workaround is to use the `androidDatabaseImplementation: 2` setting as described in the **Android sqlite implementation** section below.
376
+
365
377
To specify a different location (affects iOS/macOS *only*):
366
378
367
379
```js
@@ -442,9 +454,13 @@ By default, this plugin uses [Android-sqlite-connector](https://github.com/liteg
442
454
var db =window.sqlitePlugin.openDatabase({name:"my.db", androidDatabaseImplementation:2});
443
455
```
444
456
457
+
**IMPORTANT:**
458
+
- As described above: by default this plugin uses a non-standard [Android-sqlite-connector](https://github.com/liteglue/Android-sqlite-connector) implementation on Android. In case an application access the **same** database using multiple plugins there is a risk of data corruption ref: [litehelpers/Cordova-sqlite-storage#626](https://github.com/litehelpers/Cordova-sqlite-storage/issues/626)) as described in <http://ericsink.com/entries/multiple_sqlite_problem.html> and <https://www.sqlite.org/howtocorrupt.html>. The workaround is to use the `androidDatabaseImplementation: 2` setting as described here.
459
+
- In case of the `androidDatabaseImplementation: 2` setting, [litehelpers/Cordova-sqlite-storage#193](https://github.com/litehelpers/Cordova-sqlite-storage/issues/193) reported that in certain Android versions, if the app is stopped or aborted without closing the database then there is an unexpected database lock and the data that was inserted is lost. The workaround is described below.
460
+
445
461
### Workaround for Android db locking issue
446
462
447
-
[litehelpers/Cordova-sqlite-storage#193](https://github.com/litehelpers/Cordova-sqlite-storage/issues/193)was reported (as observed by several app developers) that certain versions of the Android database classes, if the app is stopped or aborted without closing the database then:
463
+
[litehelpers/Cordova-sqlite-storage#193](https://github.com/litehelpers/Cordova-sqlite-storage/issues/193) reported (as observed by several app developers) that certain versions of the Android database classes, if the app is stopped or aborted without closing the database then:
448
464
- (sometimes) there is an unexpected database lock
0 commit comments