Lectori Salutem,
I've run into this oddity where a tableview crashes after it has been reloaded exactly 100 times. It's no use to do it in a loop, that doesn't refresh the table properly but when you click the button 100 times and let the table reload properly the app crashes (not joking).
I've reduced my code to the minimum and can reproduce it.
Sample with database is attached. I've no clue whether it's the sql connection or the tableview or DBUtils.
Hope someone can shed a light on this.
Cheers,
Leon
B4J 9.5
Java 11
DBUtils 2.11
I've run into this oddity where a tableview crashes after it has been reloaded exactly 100 times. It's no use to do it in a loop, that doesn't refresh the table properly but when you click the button 100 times and let the table reload properly the app crashes (not joking).
I've reduced my code to the minimum and can reproduce it.
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
#AdditionalJar: sqlite-jdbc-3.7.2
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private TableView1 As TableView
Private Label1 As Label
Private sql As SQL
Private counter As Int
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
sql.InitializeSQLite(File.DirApp, "chinook.db", True)
End Sub
Sub Button1_Click
counter = counter + 1
DBUtils.ExecuteTableView(sql, "SELECT artists.Name, albums.Title, tracks.Name FROM artists, albums, tracks WHERE albums.ArtistId = artists.ArtistId AND tracks.AlbumId = albums.AlbumId" , Null, 0, TableView1)
Label1.Text = "Refreshed " & counter & " times."
End Sub
Sample with database is attached. I've no clue whether it's the sql connection or the tableview or DBUtils.
Hope someone can shed a light on this.
Cheers,
Leon
B4J 9.5
Java 11
DBUtils 2.11