SQLite: unable to open database

1

Application using ionic / cordova (SQLite).

I'm using the $ cordovaSQLite plugin inside the app. When I give a save, I modify something in the project, the simulation in the brownser (GoogleChrome) is extremely slow to load and when it loads the following errors appear:

  

unable to open database, failed to start transaction (5 database is   locked)

     

Uncaught DOMException: Failed to execute 'openDatabase' on 'Window':   unable to open database, failed to start transaction (5 database is   locked)

This is how I create and open my bank:

db = window.openDatabase("FidelisApp", "1.0", "DB Teste", "5000");
$cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS Users (userID text primary key, correio text, name text, phone num, senha num, cep num, endereco text, bairro text, cidade text, estado text, pais text)");

One of the ways I use my SQLite database:

var query = "INSERT INTO users (userID, correio, name, phone, senha, cep, endereco, bairro, cidade, estado, pais) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
            $cordovaSQLite.execute(db, query, [userData.uid, user.correio, user.name, user.phone, user.senha, '', '', '', '', '', '']).then(function(result) {
                console.log("INSERT ID -> " + result.insertId);
            }, function(error) {
                console.error(error);
            });

First I'm using SQLite, help me!

    
asked by anonymous 09.12.2016 / 17:20

0 answers