Angularjs, SQLite and iOS: why I cannot insert more than 995 records?

Hello everyone,

I tried an example of insertion of 1,000 records in a sqlite database, with angularjs and sqlite plugin (installed with ngcordova). It works well in a desktop environment: all the records has been inserted.

When I try the code in the iOS iPhone 4S environment (compiled or emulated it is the same), it only inserts the first 995 records and then it stops.

Any suggestions?

The app.js main code is the following:

var db = null;

var example = angular.module('starter', ['ionic','ngCordova']);

example.run(function($ionicPlatform, $rootScope, $cordovaSQLite) {
   $ionicPlatform.ready(function() {
      
      // open the db
      db = $cordovaSQLite.openDB({name: "myDB.db"});

      max = 1000;
      $rootScope.loadedData = 0; // just for testing purpose
      $rootScope.loadedDataErrors = 0; // just for testing purpose

      // table creation
      $cordovaSQLite.execute(db, "CREATE TABLE myTable (id INTEGER PRIMARY KEY, first TEXT, second TEXT)");

      // reset the table
      $cordovaSQLite.execute(db, "DELETE FROM myTable");

      for(i = 1 ; i <= max ; i++){
         query="INSERT INTO myTable (first,second) VALUES ('"+i+"_first"+"','"+i+"_second"+"')"; // i_first, i_second
         $cordovaSQLite.execute(db, query).then(function(res){
            $rootScope.loadedData += 1;
          }, function(error){
             console.log(error);
             $rootScope.loadedDataErrors += 1;
          }); // .execute
      }; // for

   }); // ready
}); // run

same problem on iPhone 5S or any emulator.
i created SO question http://stackoverflow.com/questions/28462266/sqlite-cordova-cant-insert-more-than-995-rows