go to post Alexey Maslov · May 17, 2017 During Cache backup it appears that all the available memory on the server is being used.It's usually not a problem as the more memory is used for buffering the quicker file i/o operates. Only free memory is used for this purpose, so memory allocated by users' or system processes should not be swapped. Please add more details, why it turned to be a problem in your case?PS. Double check in console log whether Cache allocates its shared memory segment using large pages as it guaranties that it is totally allocated at Cache startup and will neither be expanded nor swapped afterwards.
go to post Alexey Maslov · Apr 28, 2017 Question may have more than one right answer.Several answers may add some useful info to each other.Complicated question may even collect several competiting answers. Who will be a judge?
go to post Alexey Maslov · Apr 28, 2017 If you are curious, you may try to do it following John's hint, but if you didn't catch the idea, better do not.
go to post Alexey Maslov · Apr 27, 2017 Raghuram,I wrote my answer before reading yoyr comment. In this very case it seems that it's nothing should be done with GUID.Happy testing!
go to post Alexey Maslov · Apr 27, 2017 While it's easy to change GUID following John's hint (if you understood the code, you already know which global node to kill, and it will be recreated on the next call), I wonder why do you want it? It seems that your instanse have migrated to another host, hense you may want to save all its requisites (including GUID) untouched. This GUID is not used by Cache itself, but may be used in some app data fields, so you may loose app level integrity.PS. If you didn't understand the code, or are cautious to change system globals, you'd better deinstall Cache and re-install it into the same folder. System DBs would be totally rewritten while your app DBs as well as cache.cpf would be left as is.
go to post Alexey Maslov · Apr 26, 2017 Neither MERGE nor ^GBLOCKCOPY move the global: they are only copy it, unless somebody KILL it's old instance after copying.
go to post Alexey Maslov · Apr 25, 2017 John, it seems that inquiring folks rarely accept answers, maybe because of their rare visits to this site.With voting feature (like some sites have) it would be possible to "auto-accept" the most voted answer(s) after some reasonable time, e.g. after two weeks.
go to post Alexey Maslov · Apr 25, 2017 Hi, Richard....to have cache run as a different user to access that macro...Running Caché for Windows using a dedicated user account (so called service account) may have some other advantages:Caché processes get ability to use MS network resources (shared folders), e.g. Caché Backup can be performed directly to remote folder; Kerberos authentication can be used.So long story short just going down the libre office route.Why do you expect that libre office route would be shorter? Do you plan to use another (not $zf(-1,...)) approach?
go to post Alexey Maslov · Apr 24, 2017 Thank you, John, for this reminder, while I prefer to deliberately enable auditing of all events for the simple reason: a few added-on disk IOPS, as well as 1GB+ of disk space for audit database (even on high loaded Caché instances) do not seem to be a great price for an ability to trace not predicted cases in production.We even met a prospect's requirement that any audit database write failure should be dealt as a critical error with a notification of admins by all means, even with shutting the Caché down!
go to post Alexey Maslov · Apr 21, 2017 Sagun, this code would fail with <WRITE> error as after opening the file for reading: ..o resfile:"RSK\CP874\" it tries to write into it: ...w $g(^ztonEDI("TXT","OUT-DATA",ind,fileno,"SEQ",seq))_$c(13),$c(10) What this code needs as the first remedy is a change of the Open command to: ..o resfile:"NWK\CP874\"
go to post Alexey Maslov · Apr 21, 2017 ... and second thing is to insert a Close command before the correspondent Open, e.g. ..c resfile o resfile:"NWK\CP874\" even if you are quite sure that the file is closed at the moment of opening. The reason is to avoid the cases when your program have failed with error without closing the file, so its open parameters (at least, the translation table setting) keep unchanged despite of subsequent Open command. Such cases often happen during development / debugging, when the error trap code is completely switched off or greatly simplified.
go to post Alexey Maslov · Apr 20, 2017 It's better to use stream wrappers instead of open/use directlyJust because of higher abstraction level of streams; nothing special inside: just the same Open/Use/etc COS commands. So, choosing one or another way of working with files can't be the source of errors itself.By the way, `open file:("NWK\table\")` is a proven and documented way of translation table setting. AFAIK, its only limitation is that it works with Open command only rather than with Use command.
go to post Alexey Maslov · Apr 20, 2017 Eduard, can you explain the main difference between Sagun's method of translation table setting: open file:"RSK\CP874\" and yours in this very case? The latter is a piece of code of %Stream.FileCharacter.cls which actually sets a table: If (table'=0) && (i%CurrFile'="") { Set io=$io Use i%CurrFile $$$SETIO(table) ; -> Do $zutil(96,18,2,table) Use io } It seems that it's some other problem, perhaps a bug. Sagun, if you provide us with a small piece of your code where you open the file, use it, and write it, it would be easier to say something.
go to post Alexey Maslov · Apr 19, 2017 Hello Eduard,Following your 1st link I've failed to find any info on 7-zip usage. It was about Libre Office stuff.No problems with 7-zip for Windows (its native OS), not worth to mention that 7z format compression method(s) of its last versions can be unsupported (and uncompressed) with old ones. If using zip format (even with 7-zip), your are quite safe.p7zip, its Linux branch, which I tried several years ago, performed very poor as it was not multi-threaded (as 7-zip was for years). So we decided to drop it mostly for this reason.One little hint about 7-zip for Windows: we use its 7za.exe build in our deployment and update procedures as it doesn't need installation and can be just dropped in any place before usage.
go to post Alexey Maslov · Apr 14, 2017 Looks like, do you use integration in Studio?Yes, I do....maybe it working so long, and you did not wait for the result. Not too long, just a few seconds. It provided an empty report, and AFAIR there was some record in its internal log that no problems were found.
go to post Alexey Maslov · Apr 14, 2017 I've tried it with Cache 2017.1.0. The first impressions are:- It completely ignored all "blockers" in the class with 300+ methods, while there was a many of them it should not pass by: 'not procedureblock', legacy flow control, etc; maybe some internal limit was exceeded. - On the smaller class it popped rather funny messages, e.g. 1 blocker 1 Method declared as "ProcedureBlock = 0" User.test.cls(+6): ClassMethod RestVars(zzzzzzsource As %String, bOref As %Boolean) As %Status [ ProcedureBlock = 0 ] 2 major 2 Usage of QUIT to exit a method User.test.cls(+24): quit $$$OK User.test.cls(+28): quit $$$ERROR($$$CacheError, $ze) Well, 'ProcedureBlock = 0' can be considered not a good style, but what if I need it in some special case? This very method restores local variables stored in a global, so it would loose all its sense be it 'procedureblock'. IMHO, there should be a facility to protect such special case methods. 'Usage of QUIT to exit a method': QUIT is standardized command to exit methods/routines/etc. IMHO it's better than RETURN as it prevents coders to exit their methods from inside the loops and try/catches constructs, so it encourages the modular coding: each module (method) should have one enter and one exit. So, many of such rules seem to be subjective. Without a facility to customize the rules this linter seems to be no more than a demo of some commercial product. P.S. As I noticed later, it never clears 'mgr/Temp/' sub-folders it creates.
go to post Alexey Maslov · Apr 14, 2017 I just wanted to add that some occurrences of `quit:$quit value quit` idiom was probably inherited from legacy coding practices, as Caché allows calling methods/functions using DO command (thus ignoring the value being returned).From the other hand, using of `quit:$quit "" quit` construct looks like an attempt to amend erroneous $$ calls of methods/routines, which did not return any value by their initial design. One might say that such design was initially wrong, as any method should return something, at least %Status which is always $$$OK.
go to post Alexey Maslov · Apr 13, 2017 It may depend on local coding traditions. Just for example, quick search using Studio's <Ctrl-F> through one of our apps (comprised 1000+ classes) showed: q:$q <lvn> q ; Found 4501 occurrence/s in 90 file/s quit:$quit <lvn> quit ; Found 126 occurrence/s in 28 file/s. if $quit ; Not found. So, it turned that about 10% of our classes used $QUIT. Not too many, but not negligible few.
go to post Alexey Maslov · Apr 13, 2017 My point was if the compiler will go as far as protecting the developer from this type of quit misshap It seems that this kind of checkup would be difficult to implement because of variety of methods how the code could be branched depending on its call type. E.g. if $quit { ... quit rc } else { ... quit } or quit:$quit rc ... ... quit Of course, both code fragments demonstrate not very good coding style, but they are semantically correct. If one gets many false positives from a (hypothetical) code checker, he would likely drop it.