Latest build this morning with 2025 R3. Earlier today with 2024 R3 (I previously had better luck with this version but it started restarting regularly after an hour or so). This is deployed on Xojo Cloud
I’ve been dealing with this pretty consistently over the past several weeks with making a small change, deploying, and hoping the change I made was the fix the app needed. My last stable app was somewhere around April last year, which was my last app version using 2024 R3
Here are some of the things I’ve added/changed going back to Novemberish:
- Added Try/Catch blocks around anything db related
- Switched from using * in my SELECT statements to only the fields needed for the SELECT
- Reduced the things being saved to the db. In some cases, I was saving some very large text in the tables, which I thought would be taking a long time to save and process the text, but this wasn’t necessary to save this data, so I just omitted it
- All db tables have appropriate indexes so SELECT happens quicker
- In some areas where I display text content to the users (questions, articles, etc.), I switched from using a picture object to determine the size (height) of the label to an HTMLViewer with a scrollable label
- There was more, but these are top of mind
I am curious about my pings/reconnects to the db tables. Basically, whenever the db needs to be touched (insert, update, delete, select), I do a Session.CheckConnectionContent, and if the db is Nil, then I reconnect. I have the two methods of these below. Can you take a look at them to see if this logic is correct? Of note, my db objects are also on the Session class as MySQLCommunityServer
Method CheckConnectionContent
dim b As Boolean
If mDbContent = Nil Then
b = ConnectToMySQLContent
Else
dim rs As RowSet
rs = mDbContent.SelectSQL(“SELECT 1 FROM DUAL”)
If rs = Nil Then
b = ConnectToMySQLContent
End If
End If
Method ConnectToMySQLContent As Boolean
dim connected As Boolean
Do
mDbContent = New MySQLCommunityServer
mDbContent.Host = app.kXojoHost
mDbContent.UserName = app.kXojoUN
mDbContent.Password = app.kXojoPW
mDbContent.DatabaseName = app.kXojoDBnameContent
connected = mDbContent.Connect()
If connected = False Then
dim desc, err As String
desc = “DatabaseMethods.DBConnect.DBName.DatabaseError”
err = ", Cannot Contect to Database " + Str(mDbContent.ErrorCode) + " - " + mDbContent.ErrorMessage
Return False
Else
Return True
End If
Loop until connected
I’m unsure if these methods are set up correctly, if they are creating/connecting to the dbs too frequently, and/or if they are contributing to the app restarts
I’ve been watching my memory usage throughout the recent days. It generally sits around 50MB, but after a recent app restart, it did shoot up to around 100MB. I do also notice when there are not a lot of people logged into the app, it seems to be ok. Yesterday and today, I had a lot of users entering the app at one time, and that is when I noticed a restart. These users are with a school. The school recently purchased the web app for its students, and they were all activating the app and going in to work on an assignment. And by “a lot”, this is only like a dozen users, not in the 100s
Does anyone have any thoughts on what to work on next? Anything I pointed out here scream to you as “that’s your problem right there”?