Sqlite Timing Problem?

Appstudio.zip (295.0 KB)

I have attached a file that contains error messages associated with app startup when I run it in the browser and error messages associated with the app when it’s running. I get the same errors when the app is running on both iOS and Android.

The error occurs when the app stores data to various tables. As the errors show, it seems that when multiple INSERTS are done consecutively to multiple tables, the previous INSERT is not completed and an error occurs. It appears that OPFS sqlite3.vsf is not installed when the app starts and that the error when the app runs is somehow related to the startup error.

Thank you for your help.

Warren

On startup of your app, when are the first calls to SQLite made?

Do not do them right away in your initial code. You need to wait until AppStudio loads all of its libraries. When that is done, the function Main() is called. You should be able to call a function with does SQLite calls from Main()

Let me know if you have questions!

Then the app just sits and waits for the user to login. The issue I see is some time after the user logs in…

I COMMENTED OUT ALL THE CODE IN MAIN…

Ignoring inability to install OPFS sqlite3_vfs: The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait().

What is Atomics.wait()?

Ignoring inability to install OPFS sqlite3_vfs: The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait().

What is Atomics.wait()?

You can ignore this message. It applies only if using the OPFS file system, which we do not recommend. It’s pretty complex to set up. We’re hoping the configuration of the library will allow the suppression of this message at some point.

I agree - something funny is going on at startup. Would you be willing to share your project?

Feel free to delete any code which runs after the startup - I only need to get enough to reproduce the issue.

How do I deal with the error I see when the app runs?

I’ll email you a zip of the project.
Thank you.

I’ll send the whole project. Do you have a facility I can use to upload it (148MB)?

Thank you

We don’t have anything ourselves for that - let me know what works for you.

Send the download details to me personally - you have the email address.

I’ll do it early afternoon..

George,

I can’t thank you enough for the EXCELLENT SUPPORT you and your team provide!

I have been using AppStudio for over 4 years and have accomplished more than I could have ever imagined. Your team is always ready to help!!

I have been relying on your Pro Support Subscription for the majority of the time.

I continue to be amazed at the value Pro Support brings to me; I would never be without it!

My most recent episode can be seen in the previous posts. An obscure combination of SQLite database operations was causing unexplainable problems. With your help, the solution to the problem ended up being related to initialization of an array: sqlList = [ ]; a simple, well known, often used line of code, unintentionally omitted 3 times in my entire app.

You saved the day!!

Thank you for the the amazing work you and your team do for all of us!

Warren Sundet

Thanks for the kind words, Warren. It was a pleasure to help you!