MySql unavailable after "Idle"

I have an app on XC that runs fine on deployment and runs well if it has not been sitting idle.

Each morning I come in and the app does not connect to that MySQL server.

I get the error:

Can't connect to MySQL server on '' (99) mySQL db load failed

IIf I restart the XC server all is back to normal.

I have 4 a dozen other XC apps running normally (Across 3 different servers)

This app is unique in that I am using BKS Active Record for the first time. (which I copied into my project from the project created by Argen)

What scrap of code am I missing that is causing the MySQL Server to hang?

(Side note. Active record and ARGEN are a major return on investment. Get them if you use databases)

Connection Timeout?

Are you sharing a connection between sessions? That’s a bad idea. Each session should get its own connection, so timeout should never be an issue.

Each Session has its own connection.

I do not think it is a connection timeout as

  1. Each session has its own connection
  2. Each morning I take my laptop out of its case and start a new connection/Session. At that point, it always fails with the same error. (So its not a connection time out)
Can't connect to MySQL server on '' (99) mySQL db load failed

Have you consumed the entire connection pool?
I was was admin for a world wide site that used mySQL, and we only allowed 100 connections at any one instant (the connections were NOT persistant)… but for some reason every once in a while, connections did not release and the pool overflowed.

Thanks for the help Dave / Tim…

I am the only user on the app. It is still in development.

The url is still http:////

However: If I restart the server-- It ALWAYS comes back w/o the connection error.

What you describe is the mysql service on XC becoming unresponsive, or timing out. Reach out to Xojo tech support on that. It shouldn’t be happening.