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
David Delač
Hi Piotr, The log entry:
2024-12-14 08:40:43 0.000 CallHal(IsHansaWorldCustomer) appears because the server is running with the verbosity=debug-detailed setting in its parameters.txt file. Thi...
09:43 16 Dec 2024
Brittany McGrath
Hi Vaughn, I can confirm this has been fixed now and is live in Standard ERP 2024-11-20 Version: 85556786. Thank you. ...
10:04 10 Dec 2024