go to post Alexey Maslov · Nov 28, 2020 The user needs to have a separate local or domain Windows account to SSH in to the server prior to logging in to Caché Any SSH server you might try (OpenSSH, etc) would act this way: to start command shell, you need to log in Windows.
go to post Alexey Maslov · Nov 20, 2020 It all sounds like a software provider in maintenance for its customers. In such a case it is usually easier to map that global from the separated database and distribute its updated copy among the customers.
go to post Alexey Maslov · Nov 20, 2020 "mirroring is unavailable for the current license" It seems that they have a single server license, so ECP is probably not an option as well.Otherwise, it's difficult to imagine the scenario when ECP remote (single!) database would not be better than duplicating the data in two databases. Just two cases come to mind: slow internet connection need to dedicate a whole server for some heavy data processing. Anna, if you tell us more about your task, we'd likely advise you better.
go to post Alexey Maslov · Oct 16, 2020 This quick solution, alas, will not survive the upgrade to IRIS as %Library.RemoteResultSet class was excluded from IRIS.
go to post Alexey Maslov · Oct 12, 2020 Julius, I enjoy your $tr solution. As to $zdth, you've just missed dformat argument, so it should be: set tmp=$e(datetime,1,8)_" "_$e(datetime,9,10)_":"_$e(datetime,11,12)_":00" write $zdt($zdth(tmp,8,3),8,3) <ILLEGAL VALUE> occurs otherwise.
go to post Alexey Maslov · Oct 1, 2020 Nick,May I ask you: where did this magic number (201772B865) come from?
go to post Alexey Maslov · Sep 30, 2020 Whenever I return "useful" value from a method I regret it afterward. E.g. set square=##class(mathCls).squareTriangle(a, b, c) What if something went wrong, e.g. actual parameters (a, b, c) are invalid? I need some sign of it, so I'm forced to add some kind of status code. Let it be of %Status type. So, the caller's code is getting more complex: set square=##class(mathCls).squareTriangle(a, b, c, .sc) if $$$ISERR(sc) $$$ThrowStatus(sc) In contrast, when the status code is returned, it is not getting significantly complex: $$$TOE(sc,##class(mathCls).squareTriangle(a, b, c, .square)) Besides, if each method returns status (even when it is always $$$OK), the whole code is looking more consistent and does not need modification if some of its methods get new behavior and able to return some error status as well.
go to post Alexey Maslov · Sep 30, 2020 Doing finalization like this you are rejecting your previous point to use $$$qoe(...).
go to post Alexey Maslov · Sep 30, 2020 Acting this way, you are just quitting your method on error. What if your method needs finalization? Both approaches have been discussed above (try/catch or $ztrap/$etrap) allow it easily.
go to post Alexey Maslov · Sep 29, 2020 Evgeny,Is it a question: try/catch (or another way of error handling) or %Status? If we try to follow some solid design principles, each method should perform only one function, have only one way to exit from, and should inform the caller whether it succeded. So, we should use both. Extending your sample: ClassMethod solid1(parameter, ...) as %Status { set sc=$$$OK try { $$$TOE(sc,##class(x.y).a()) $$$TOE(sc,##class(x.y).b()) ... $$$TOE(sc,obj.NormalMethod(parameter)) ... } catch e { // error handling set sc=e.AsStatus() } // finally... common finalization for both (good or bad) cases return sc } One could write it in another fashion, e.g. ClassMethod solid2(parameter, ...) as %Status { set sc=$$$OK new $estack,$etrap set $etrap="if $estack=0 goto errProc" set sc=##class(x.y).a()) if 'sc goto solid2Q set sc=##class(x.y).b()) if 'sc goto solid2Q ... set sc=obj.NormalMethod(parameter) if 'sc goto solid2Q ... solid2Q // finally... common finalization for both (good or bad) cases return sc errProc // common error handler // error handling set sc=$$$ERROR(5001,"solid2 failed: "_$ze) goto solid2Q } Which version is better? If we don't need individual error handling of ##class(x.y).a(), ##class(x.y).b(), etc calls, I'd prefer solid1. Otherwise, solid2 seems to be more flexible: it's easy to add some extra processing of each call return. To achieve the same flexibility in solid1, we are to cover each call in an individual try-catch pair, making the coding style too heavy.
go to post Alexey Maslov · Sep 11, 2020 ...as much as possible avoid the need to use subscript level mapping (SLM) to manage growth of a single global across multiple databases. Ray, may I ask you: why should we avoid it?
go to post Alexey Maslov · Sep 11, 2020 Several ##class can be eliminated, making the code shorter and readable writable better: ClassMethod CRUDUser(id, name) As %String { q:'$d(name) "Name required" s x=$classmethod("Data.User",$s($g(id)="":"%New",1:"%OpenId"),$g(id)) q:'x "User not found" s x.Name=name q $s(x.%Save()=1:"User saved",1:"Error saving") }
go to post Alexey Maslov · Sep 4, 2020 Nigel,I'm OK with the answers given by Eduard and Danny. After moving to VS Code situation with snippets would be even better.Thank you again.
go to post Alexey Maslov · Sep 4, 2020 Thank you, Nigel. Multi-line macros don't meet my needs. What I really need are fillable patterns (templates), to prompt developers on writing methods (functions) descriptions in a standardized manner, something like this: /// -------------------------------------------------------------------------------------------- /// Method purpose /// /// **Arguments** /// /// #. *pArg1*: /// #. *pArg2*: /// /// **Returns** /// /// /// **Notes** /// /// /// **Call sample** /// :: /// /// ; code line 1 /// ; code line 2 ///
go to post Alexey Maslov · Sep 2, 2020 Daniel,Not talking about whether $zerror/$ztrap is good or bad, false positives and negatives can be avoided if use it right way. The well-known pattern is as follows: rouA set $ze="",$zt="rouAerr" ... set sc=$$funB() if 'sc quit sc ... quit sc rouAerr set $zt="" ; that's of great importance! set sc=$$$ERROR(5002,$ze) ; just a sample of processing $ze... quit sc funB() set $ze="",$zt="funBerr" ; while not neccessary, local $ztrap can be defined ... quit sc funBerr set $zt="" set sc=$$$ERROR(5002,$ze) quit sc
go to post Alexey Maslov · Sep 2, 2020 I am not putting my hopes on GBLOCKCOPY due to its limitations This precaution sounds strange in your context: if you are simply copying a set of globals that are actively being modified, you will get an unpredictable result nevertheless the utility you choose. To make a consistent copy, one should apply journal records or (if copying to another Cache instance) use some cross-system technique, such as Mirroring or Shadowing, while both require Multi-Server cache.key. If you tell us more about the task you are trying to solve, we'd advise you better.
go to post Alexey Maslov · Jul 31, 2020 Public recognition by developer level Other vendors from your list have some kind of developer certification as well. E.g., https://docs.microsoft.com/en-us/learn/certifications/Or you meant something else, didn't you?