Hello everyone,
I’m working on a Xojo Web application that previously used SQLite and has now been migrated to MariaDB. Since the migration, I’ve encountered an issue: When populating a Listbox, an Event Loop error occurs, causing the application to freeze.
What happens?
The database connection works (login and other queries execute successfully).
The SQL query returns valid data.
However, the Listbox is not updated correctly – sometimes values are missing, or no rows are displayed.
Shortly after entering the While Not rs.AfterLastRow loop, the app freezes, and the debugger only shows “Event Loop.”
To rule out any interference with the login process, I have now moved this method out of the login flow and instead trigger it manually via a button click to ensure all previous processes have completed – but the issue persists.
My code for populating the Listbox:
Var rs As RowSet = db.SelectSQL(“SELECT name FROM users WHERE active = 1”)
If rs = Nil Then
System.DebugLog(“Error: RowSet is Nil!”)
Return
End If
While Not rs.AfterLastRow
System.DebugLog("Row Data: " + rs.Column(“name”).StringValue) // Debug output works!
Listbox1.AddRow(rs.Column(“name”).StringValue)
rs.MoveToNextRow
Wend
What I have tried so far:
Checked the SQL query → The data appears correctly in Navicat.
Verified whether the RowSet is nil or empty → The RowSet is valid and contains data.
Added debug output before updating the Listbox → The values are correctly retrieved from the database.
Limited the loop iteration (count < 10) → No difference, the problem persists.
Tried adding all rows after the loop instead of inside it → No improvement.
Checked rs.MoveToNextRow behavior → Looks normal, but could this be causing the issue?
Moved the method out of the login process → It is now triggered by a button click, but the problem remains.
Questions:
Has anyone experienced similar issues with Xojo Web 2.0 and MariaDB?
Are there known issues with rs.MoveToNextRow or Listbox.AddRow in Xojo Web?
Could this be related to a UI thread problem? (I am not explicitly using any threads)
I appreciate any help or suggestions!
Best regards,