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

Cannot close DB in db.executeSql() callback #204

Open
brody4hire opened this issue Mar 12, 2015 · 0 comments
Open

Cannot close DB in db.executeSql() callback #204

brody4hire opened this issue Mar 12, 2015 · 0 comments

Comments

@brody4hire
Copy link

The following test fails, reproducing the issue:

        if (!isWebSql) test(suiteName +
            ' close DB in db.executeSql() callback', function () {

          // async test coming up
          stop(1);

          var dbName = "Close-DB-in-db-executeSql-callback.db";
          openDatabase({name: dbName}, function (db) {
            db.executeSql("CREATE TABLE IF NOT EXISTS tt (test_data)", [], function() {
              db.close(function () {
                ok(true, 'DB close OK');
                start(1);
              }, function (error) {
                ok(false, "Could not close DB: " + error.message);
                start(1);
              });
            });
          }, function (error) {
            ok(false, error.message);
            start(1);
          });
        });

I discovered this issue while making some tests for the new version for sqlcipher.

brody4hire pushed a commit that referenced this issue Mar 18, 2015
Clean separation between SQL tests (which should apply to both Web SQL and this plugin) and plugin-specific tests.

Add reproduction of minor bug #204.

Move reproduction of #209 to section with plugin-specific tests.

Mark some plugin db tests that were added by Mark Oppenheim (mailto:[email protected]) as "Needed to support some large-scale applications".

Test repeatedly open and close db two ways (whether or not to wait for open callback before closing db)

Add another test of repeatedly open and delete db (wait for open callback before deleting db)

Needed for #184/#204/#209/#210/#211/#213.
brody4hire pushed a commit that referenced this issue Mar 18, 2015
…ase that is being opened (#184).

Document related txLocks & openDBs map objects.

Mark other bugs to be fixed (#204/#209/#210).
brody4hire pushed a commit that referenced this issue Mar 18, 2015
CHANGES:
- Use per-db state to properly handle transactions requested on a database that is being opened (#184).
- Report an error upon attempt to close database multiple times.

TEST:
- Reproduce BUGs #204/#209
- Expand some existing scenarios
- Prepare test suite for upcoming fixes and improvements (#184/#204/#209/#210/#211/#213)
brody4hire pushed a commit that referenced this issue Mar 18, 2015
CHANGES:
- Use per-db state to properly handle transactions requested on a database that is being opened (#184).
- Report an error upon attempt to close database multiple times.

TEST:
- Reproduce BUGs #204/#209
- Expand some existing scenarios
- Prepare test suite for upcoming fixes and improvements (#184/#204/#209/#210/#211/#213)
brody4hire pushed a commit to brody4hire/Cordova-sqlite-storage-common-dev that referenced this issue Apr 25, 2016
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

1 participant