Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash with larger batches (+/- 80MB) on Android #83

Closed
brodycj opened this issue Apr 22, 2021 · 1 comment
Closed

crash with larger batches (+/- 80MB) on Android #83

brodycj opened this issue Apr 22, 2021 · 1 comment

Comments

@brodycj
Copy link

brodycj commented Apr 22, 2021

In response to a customer inquiry, I have reproduced the crash on Android with batches starting with about 80 MB on an emulator with extra-high 4 GB memory. This crash persists on both evcore and evplus plugin versions and goes beyond the cases discussed in issues #55 & #70.

Here is a reproduction test case similar to what I made for issue #70:

      describe(suiteName + 'XL transaction column value insertion test(s)', function() {
        it(suiteName + 'INSERT JSON TEXT string many rows with hundred properties each (...)', function(done) {
          var db = openDatabase('INSERT-JSON-TEXT-string-many-rows-with-hundred-properties.db')

          var test_rows = 15500
          var test_props = 100

          db.transaction(function(tx) {
            tx.executeSql('DROP TABLE IF EXISTS test_table');
            tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (data)', [], function(ignored1, ignored2) {

              for (var id=0; id<test_rows; ++id) {
                var obj = {}

                obj.id = id;

                for (var i=0; i<test_props; ++i) {
                  obj['prop'+i] = 'value-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa-'+(1000+i)
                }

                var insert_data = JSON.stringify(obj)

                tx.executeSql('INSERT INTO test_table VALUES (?)', [insert_data])
              }

              tx.executeSql('INSERT INTO test_table VALUES (?)', ['{extra:true}'], function(tx_ignored, rs1) {
                expect(rs1).toBeDefined();
                expect(rs1.rowsAffected).toBe(1);

                tx.executeSql('SELECT COUNT(data) AS count FROM test_table', [], function(tx_ignored, rs2) {
                  expect(rs2).toBeDefined();
                  expect(rs2.rows).toBeDefined();
                  // expect(rs2.rows.length).toBe(???);

                  var row = rs2.rows.item(0);
                  expect(row.count).toBeDefined() // [TBD (...)]

                  done();

                });
              });
            });
          }, function(error) {
            // NOT EXPECTED:
            expect(false).toBe(true);
            expect(error.message).toBe('---');
            // Close (plugin only) & finish:
            (isWebSql) ? done() : db.close(done, done);
          });
        }, MYTIMEOUT);
      });
@brodycj
Copy link
Author

brodycj commented Jan 11, 2022

I published a new evmax plugin version tested beyond 1 million records, 200 bytes per record last year: https://github.com/storesafe/cordova-sqlite-evmax-build-free

and a version with encryption using SQLCIpher: https://github.com/storesafe/cordova-sqlcipher-evmax-ext-build-free

... and posted some info on the website: https://storesafe.io/

@brodycj brodycj closed this as completed Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant