Global update / Temporary global
I wonder if you could help me with a problem with persistent globals and journals.
We have a few interfaces using a persistent global just to translate some codes. The use of that global is like a lookup table...an interface calls a method that search for a field (in the message) in the global. If found, the code is translated with another field from the global.
The format of the global is something like:
The method that search for the code in the global and translate the code is using a SQL query against the global:
This can be done because the global is a persistent class with a SQL table linked to it defined like:
All this is working fine...the problem is how to update that global. Because is used for some LIVE interfaces, downtime needs to be minumum and the problem is the number of entries in the file that needs to update that global...about 60,000. I though having another global similar as that one to import the data from the file, then remove duplicate entries (yes, the file can contain duplicate values that need to be removed). Once the data is in the copy global, the global is exported to a file and changed the name of the global so it can point to the LIVE global. Once that is done, it can be easily imported into the LIVE global reducing the downtime of the interfaces to just a few seconds (just the time to import the global from a global import file).
Problems with this:
1) I am not sure if this is the right way to do it but it is all I could think with my basic knowledge.
2) Because of the process to remove duplicate entries from the copy global, there are a few operations that remove entries from that global...all this generates entries in the journal that at the end take huge amount of disk space. I was told, global can be changed to temporary global (https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...) making those actions not to be logged in the journal file. The problem with this is that I am not sure how to convert/specify my copy global is temporary...I tried to change the name to start with CACHETEMP (XXX.Stored.CACHETEMPglobalxxx) or change name of the class to start with CACHETEMP (CACHETEMP.Stored.globalxxx)...but I am not quite sure this is working.
Suggestions, help, feedbacks, ideas...will be more than welcome!