Long running background maintenance
Aldevinas Katkus
3-13-23
Operating system: Windows
Can we write a maintenance which updates DB without affecting logged in users?
I can see AmazonImportOrdMn() calls qupdating procedure.
Also I can see some threadasync calls in NexmoSIPTrunkNSMn().

Should threadasync calls work better (not affect the work of logged in users) if the maintenance is deleting a million(s) of old RHistVc records for about an hour or more?

3-14-23
Hi Aldevinas,

Thanks for the question!

I have forwarded the question to the product development team.

Will let you know when we have an answer.

Brgds
Rasmus
David Delač
3-23-23
Hi Aldevinas,

Code executing on the main thread will always affect the users online. The code you're referring to is used for parallel maintenances but since the function is called as qupdating it will still run on the main thread and block it.

Best regards,
David D.
Aldevinas Katkus
3-23-23
Maybe I haven't been specific enough. I meant, usually, if we run a long maintenance, then logged in users are blocked with a message "server busy". So using parallel maintenance should not block users with "server busy"?
David Delač
3-23-23
Hi Aldevinas,

Parallel maintenance is a technique used to avoid blocking threads during operations that require going through a large number of records. For instance, imagine you need to loop through all invoices but only want to update a few of them. In this case, the invoices that require updating would be processed in a separate function that is called as qupdating. This way, the other threads can continue executing without being blocked, and users won't experience any performance issues. However, if the main thread is blocked for a significant amount of time, users might see the message you described.

Unfortunately, in your case, the best solution is to run the maintenance during off-hours, such as overnight, to avoid impacting users' experience.


I hope this cleared it out, let me know if you have any additional questions.

Best Regards,
David D.
David Delač
3-23-23
I would also like to add that a good example of that is AmazonImportOrdMn() where API call is not blocking the thread (AmazonMWSImportAmazonOrders) but later when records need to be updated, there is qupdating call which executes on main thread and blocks it for short amount of time.
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Hi, Thank you for reaching out! What error do you get in server log and client log when you run the report? Please check that you have Multi Thread activated in Systems>>Settings>>O...
09:10 15 Apr 2024
Hello, Thank you for reaching out! We did testing in sample data in current released version 2024-03-16. This is not repeatable with this combination. We recommend you to report this as a bug w...
09:08 15 Apr 2024