Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Issue with ngCordova and SQLite #1390

Open
mdemarco1234 opened this issue Dec 8, 2016 · 1 comment
Open

Issue with ngCordova and SQLite #1390

mdemarco1234 opened this issue Dec 8, 2016 · 1 comment

Comments

@mdemarco1234
Copy link

     Code is in Angular controller and the db does open but on the execute line console.log() never gets called and infact the line of control falls below the ending bracket. Db does not insert at all.

Messages I got were database already open which it was but the new transaction is waiting for open operation happens after the open and I think is the source of the problem. I did trace into the code and see where this message came from but what should be done about it

database already open: trackergomobile.db
SQLitePlugin.js:105 new transaction is waiting for open operation

    var db = $cordovaSQLite.openDB({ name: 'trackergomobile.db', location: 'default' });


    var query = "insert into dbo_User (createdate, phone, emailaddress, mobile, firstname, lastname, companyid, address, city, state, website, twitter, linkedin, facebook, companycontact) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    $cordovaSQLite.execute(db, query, ['2012-12-09 22:51:24', '111111', 'michael@hotmail.com', '3333333', 'Mike', 'De Marco', 3, '44444444', 'Chatsworth', 5, '44448888', 'GGGGGGGG', 'XXXXXXXXX', 'SSSSSSSSS', 0]).then(function (res) {
        console.log("Nice")
        }, function (err) {
          console.error(err);
        });
@mdemarco1234
Copy link
Author

One other thing in the core the code was and I noticed that this if failed because this.openDBs[this.dbname] was the same as DB_STATE_INIT

    if (this.dbname in this.openDBs && this.openDBs[this.dbname] !== DB_STATE_INIT) {
        this.startNextTransaction();
    } else {

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

No branches or pull requests

1 participant