I'm currently using a database for some regular message updates (partly due to resources and partly because I don't yet understand servers - I may move over as time passes but I want to get to grips with MySQL first), and my code (when running) opens a connection, queries the database, and closes the connection every two seconds.
This, by itself, works fine. I haven't got any errors in the basic design, nothing I add is causing problems with that.
But while it's doing this, the screen locks - or perhaps freezes - for about half a second. During this time, the user may be constantly typing, which means that a split second freeze can cause sentences to stt loing lke tis as letters don't register during the freeze.
Is there any way to avoid this within the bounds of my current system or is this a limitation of databases and database querying within LiveCode?
Database Query Screen Lock
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Database Query Screen Lock
I don't know in detail what you try to do, or how your code looks but you could try using the dispatch command that will execute a message in a new thread.
Write a message with your SQL statement, for example:
Use the dispatch command to execute the message:
Write a message with your SQL statement, for example:
Code: Select all
on messageUpdateConnectToDb
-- add your code to connect to the database
end messageUpdateConnectToDb
Code: Select all
dispatch messageUpdateConnectToDb