The MySql plugin that ships with Xojo is the culprit. It does not allow multiple queries to the database. I you have multiple queries it will crash in such a way that when the next request comes in will spawn a new instance of the application.
Eventually all the instances will choke the server.
We wrapped every single interaction with the MySql BD in “Critical Section” and the problem has disappeared. We did this a few weeks ago and all our crashes and multiple instance have stopped.
@Norman Palardy Thanks for the help. But your help raises two more questions, so I am afraid I will have to ask for more help.
It appears that Gregs answer is at odds with yours. Explain?
You are correct the critical section it throttles my database queries. But since the Plugin is the cause of the crash. and it works around a bug that only Xojo Inc can fix: What would you suggest I do about it? (or am I missing something?)
Greg is talking about instances of the app. Norm is talking about something different: instances of the database. You should not share a database object between sessions. Each session should get its own database object and therefore its own connection to the database. One app, multiple database objects, multiple connections to the database.
Again: never share a database connection between sessions.
[quote=238645:@Jay Menna]@Norman Palardy Thanks for the help. But your help raises two more questions, so I am afraid I will have to ask for more help.
It appears that Gregs answer is at odds with yours. Explain?
[/quote]
Not at all
Xojo Cloud should be running one instance of the APP - the app can have lots of sessions
[quote=238645:@Jay Menna]
2. You are correct the critical section it throttles my database queries. But since the Plugin is the cause of the crash. and it works around a bug that only Xojo Inc can fix: What would you suggest I do about it? (or am I missing something?)[/quote]
You’re using one connection for the entire app
I’d put the connection on each session that way each session has its own connection & communications wont be interleaved
Going back to the original question, the fact that there are multiple versions of the actual Betty47 app running is mostly an issue of memory. You’ll notice in your logs that they’re all using 0.0% cpu.
Usually this indicates a circular reference somewhere in your app which causes sessions to not shut down properly, and thus cause the app to never quit.
Norman I t look like you and I got lost on the word "instance " Greg and I spent significant running down a very bad issue in my app where multiple instance of THE APPLICATION were being spawned. (Hence the title of the original post)
There is one DB connection for each session. Apologies for the confusion if I implied otherwise.
Greg: We found the problem and fixed it 3 weeks ago. It was the Mysql plugin.