storesafe / cordova-sqlite-storage

A Cordova/PhoneGap plugin to open and use sqlite databases on Android, iOS and Windows with HTML5/Web SQL API
Other
2.14k stars 713 forks source link

Error while making multiple queries #977

Closed manuelconcini closed 2 years ago

manuelconcini commented 2 years ago

In my project I need to make a lot of queries (more than 2000) in a short time. Following code works only for a little amount of queries (max 78).

db.transaction(function(tx) { console.log("Execute " + queries_and_params_arr.length + " queries!"); for (var i = 0; i < queries_and_params_arr.length; i++) { count++; var query = queries_and_params_arr[i].query; var params = queries_and_params_arr[i].params; (function(arr_obj) { tx.executeSql(query, params, function(tx, resultSet) { checkCallback(true, arr_obj); }, function() { checkCallback(false, arr_obj); }); })(queries_and_params_arr[i]); } });

When I try executing more than 1000 queries, Google Chrome console stop working and all the web app stops.