WebReflection / dblite

sqlite for node.js without gyp problems
MIT License
209 stars 34 forks source link

Database is locked #30

Closed nkint closed 9 years ago

nkint commented 9 years ago

Sorry, here again. I am testing the system done with dblite and after a two days of testing I got this error:

`Error: Error: near line 44372: database is locked

It caused the next query to fail. Is there any workaround? Or maybe I'm handling the errors in the wrong way?

WebReflection commented 9 years ago

you have an error so I guess you are doing it right but without code how am I suppose to answer ?

feels more like there's no space anymore so the file stays locked and you can't add anything else … or … really, I need code to say what is it about ;-)

nkint commented 9 years ago

It happens inside a nested query:

model.getMachine(node_id, function(res) { // this is a SELECT * FROM Node WHERE node_id= ?;
    if(res.length!=0) {
        model.modifyMachine(…., function(result) { // this is a UPDATE Node SET node_id=….
           ...
        });
    } else {
        var defaultLabel = type+node_id;
        model.addMachine(…., function(result) { // this is a INSERT INTO Node VALUES(...
           …
        });
    }
});
WebReflection commented 9 years ago

there is not a single bit of code related to dblite in there … anything else I can verify ?

WebReflection commented 9 years ago

had no answer in ages, will close this

nkint commented 9 years ago

yes, sorry, it is resolved. thanks!