Hello dear users,
in our database we have an error with the Schema Synchronization causing the Service Tier to die and using 100% of the CPU.
The error seems to be caused by our Upgrade Codeunit. However, when we comment out or delete the following lines everything works perfect.
Object.GET(Object.Type::Table,'',DATABASE::"OUR TABLE");
IF (STRPOS(Object."Version List",'XXX9.03') > 0) OR (STRPOS(Object."Version List",'XXX9.04.00.00') > 0) THEN
DataUpgradeMgt.SetTableSyncSetup(DATABASE::"OUR TABLE",0,TableSynchSetupVar.Mode::Force)
ELSE
IF ((STRPOS(Object."Version List",'XXX9.04') > 0) OR (STRPOS(Object."Version List",'XXX9.05.00.00') > 0)) AND (NOT FunctionExecuted('SBAT2','')) THEN
DataUpgradeMgt.SetTableSyncSetup(DATABASE::"OUR TABLE",DATABASE::"OUR UPGRADE TABLE",TableSynchSetupVar.Mode::Copy)
ELSE
DataUpgradeMgt.SetTableSyncSetup(DATABASE::"OUR TABLE",0,TableSynchSetupVar.Mode::Check);
With this seven lines of code in the codeunit, I try to edit Table18, Customer and add a new field.
After saving the changes with CTRL+S and selecting the validation - now option, I have to restart the service tier since it uses 100% of the machines CPU, as I already said.
Has anyone ever faced problems like these before or has an idea of how to fix it? When I tried to reproduce the error on a NAV90 Demo Database everything works as it should, the problem is that part of the codeunit.
Thanks in advance.
Answers
In other words, you can only use a GET; on system tables when it comes down to upgrade codeunits.