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

Database isn't closed on Android devices #153

Closed
MacMario opened this issue Oct 30, 2014 · 3 comments
Closed

Database isn't closed on Android devices #153

MacMario opened this issue Oct 30, 2014 · 3 comments

Comments

@MacMario
Copy link

Hi there!

I expericenced problems when closing the SQLite Database on Android devices after each statement executed (this is necessary in my case to enable other components to connect to the DB).

I figured out that the database is removed from the dbrmap (SQLitePlugin.java @ Line 802) before it is tried to be closed @ Line 804.

Therefore the DB is not closed (mydb is null @ Line 277), but no error is raised. On Android devices, I received "A SQLiteConnection object for database was leaked!" errors after some Sqlite calls.

Swapping the two lines 802 and 804 resolves this issue.

@nolanlawson
Copy link
Contributor

could you submit a pull request and a unit test please? :D

brodybits referenced this issue in MacMario/Cordova-SQLitePlugin Feb 25, 2015
Without this modification, the database is removed from the dbrmap
before it is tried to close.
@brodybits
Copy link
Contributor

Same issue and same solution were already given in #150.

brodybits pushed a commit that referenced this issue Mar 10, 2015
Fixes:
- #193: workaround for Android db locking/closing issue
- #144: convert array parameters to string to match Web SQL
- #199: fix double-precision REAL values in result for iOS version
- #150/#153: close Android db before removing from map
- Fix truncation in iOS query result in case of UNICODE NULL (\0 or \u0000) (ref: PR #170)
- Some fixes for error handling to be consistent with Web SQL (ref: PR #170)

Testing ONLY:
- #147: testing with UNICODE line separator
- #195: Reproduce issue with double-precision REAL number on WP(8) ONLY
brodybits pushed a commit that referenced this issue Mar 10, 2015
Fixes:
- #193: workaround for Android db locking/closing issue
- #144: convert array parameters to string to match Web SQL
- #199: fix double-precision REAL values in result for iOS version
- #150/#153: close Android db before removing from map
- Fix truncation in iOS query result in case of UNICODE NULL (\0 or \u0000) (ref: PR #170)
- Some fixes for error handling to be consistent with Web SQL (ref: PR #170)

Testing ONLY:
- #147: testing with UNICODE line separator
- #195: Reproduce issue with double-precision REAL number on WP(8) ONLY
@brodybits
Copy link
Contributor

The fix is now published (see #150).

brodybits pushed a commit that referenced this issue Mar 10, 2015
Related to the following fixes:
- #193: workaround for Android db locking/closing issue
- #144: convert array parameters to string to match Web SQL
- #199: fix double-precision REAL values in result for iOS version
- #150/#153: close Android db before removing from map
- Fix truncation in iOS query result in case of UNICODE NULL (\0 or \u0000) (ref: PR #170)
- Some fixes for error handling to be consistent with Web SQL (ref: PR #170)
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

3 participants