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
Reino Botha
Please check your version of android if it is the same as the server you are connecting too. ...
08:24 21 Nov 2024
Bror-Erik Kotiranta
In NC you hace operations>>ai chats. They are used for these Br, Bror-Erik...
05:12 21 Nov 2024