Failed adding to JNI local ref table (has 512 entries) using jSqliteDataAccess lazarus / 43-Android ---------------------------------------------------------------------- Robert Gilland · 2020-06-06 10:01 Why is this Code failing sdamovies is a jSqliteDataAccess object connecting to a jDBListView component I/frmMovieSearch( 5464): 20200606095823302:Calling InsertIntoTableBatch 500 movies E/dalvikvm( 5464): JNI ERROR (app bug): local reference table overflow (max=512) code is: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  procedure BatchProcessMovies;  var    i : Integer;    liBatchCount : Integer;  stmtArray: TDynArrayOfString;    lMovieObj : TMovieObj;    lsTableValues : String;   begin    if( slMovies.Count > cntMaxRows )then      liBatchCount := cntMaxRows   // 500    else      liBatchCount := slMovies.Count;    SetLength(stmtArray, liBatchCount);    i := 0;    while( i < liBatchCount )do      begin      inc(liIdx);        lMovieObj     := TMovieObj( slMovies.Objects[0] );        lsTableValues := IntToStr(liIdx) + ',' +          QuotedStr(lMovieObj.DiskName) + ',' +          QuotedStr(lMovieObj.FullFileName);        lsSQL :=  'INSERT INTO MOVIES ( MOVIEID, DISKNAME, FULLFILE ) VALUES (' + lsTableValues + ')';        inc(i);        stmtArray[i] := lsSQL;        DoLog('Batch SQL: ' + lsSQL);        slMovies.Delete(0);      end;    if( liBatchCount > 0 )then      begin        DoLog('Calling InsertIntoTableBatch ' + IntToStr(liBatchCount) + ' movies');        sdamovies.InsertIntoTableBatch(stmtArray);        SetLength(stmtArray, 0);        DoLog('Called InsertIntoTableBatch');      end;  end; ---------------------------------------------------------------------- Robert Gilland · 2020-06-07 00:17 Now I am getting: I/frmMovieSearch( 2265): 20200607001321448:Calling InsertIntoTableBatch 200 movies E/SQLiteLog( 2265): (21) API called with NULL prepared statement E/SQLiteLog( 2265): (21) misuse at line 63243 of [00bb9c9ce4] W/System.err( 2265): android.database.sqlite.SQLiteException: not an error (code 0)