Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safer Android defaults #671

Open
brodycj opened this issue Apr 20, 2017 · 2 comments
Open

Safer Android defaults #671

brodycj opened this issue Apr 20, 2017 · 2 comments

Comments

@brodycj
Copy link
Contributor

brodycj commented Apr 20, 2017

This plugin uses Android-sqlite-connector together with Android-sqlite-native-driver by default. There is a risk that an app developer may run into http://ericsink.com/entries/multiple_sqlite_problem.html when accessing the same database from custom plugin classes as well (#626).

It would be safer if the plugin would use the builtin android.database.sqlite classes instead and require a setting such as androidDatabaseImplementation: 1 to use the more efficient Android-sqlite-connector together with Android-sqlite-native-driver.

In addition there is a androidLockWorkaround: 1 setting to enable a workaround for a data loss issue reported for certain versions of Android in 2014/2015 (#193). While this is not the fault of the plugin an optional workaround solution (close and reopen after every COMMIT) was needed. It would be safer to enable this workaround by default and add an "optimization" option to turn it off if desired.

This was partially triggered by the discussion in storesafe/cordova-sqlite-storage-help#18.

@luigi37
Copy link

luigi37 commented Apr 21, 2017

Hi Chris, small doubt... do you suggest to use

androidDatabaseImplementation: 1 

or

androidDatabaseImplementation: 2

In this message I understand 1 but from the other I understood 2...

Also, would you post a short example line with both parameters indicated?

Thanks

@brodycj
Copy link
Contributor Author

brodycj commented May 12, 2017

It is safest to use androidDatabaseImplementation: 2 and androidLockWorkaround: 1. My idea is that this should be done by default ref: #687.

The idea to use androidDatabaseImplementation: 1 for the more efficient Android-sqlite-connector implementation was just an idea. I am thinking to use a different option key such as opt or optimization to specify the use of the more efficient Android implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants