It might be because you are opening the database twice. Only open it once and do all of your transactions on that single instance. Also make sure that your previous transaction has finished before starting another one. You shouldn’t have to worry about that, but in my experience Cordova’s (PhoneGap) WebSQL is a bit finicky.