· Nov 11, 2020

Running code on another machine

Hi everybody,

Is there a way to run code on another machine? Of course, all authentication info is known. I know only about RemoteResultSet but that seems to be query specific.

Thanks in advance,
P.S. The ultimate goal, in case that matters, is to create identical globals on 2 different machines with one run.

Discussion (22)2
Log in or sign up to continue

Hello @Anna Golitsyna!
the 3rd example is 1 class that contains 2 basic functionalities:  A Server and a Client.
The system you want to control runs the ClassMethod Server.
- opens an IP port and listens for orders, execute it, and continue looping.
- it is typically started in the background during  system start (from %ZSTART.mac)
This is the "hidden Login"

The (Classmethod) Client connects to the listening port and sends a request and gets answers.
The structure of Requests and Answer is up to you and makes sure you have always control
over what should happen on the remote system. As your  "Listener" is active already there
is no need for any further login. But you are of course free to implement it on top of this basic mechanic.

Mirroring is about creating identical globals on multiple machines with one update.  I assume you don't want these systems exactly the same, but depending on what you do want, maybe you could find a configuration which would do it.  For example, maybe you could put the global you want replicated in its own database on an async member and not mirror any other databases.

@Katherine Reid My goal is to update two globals on two different machines at the same time. That needs to be done from time to time only. Would or could "other async mirrors purposes" include that? If so is there any technical reading or specific classes, or the namespace setup, related to async mirroring that you would recommend to use for such a job? For example, this 101 guide, , specifically states "Deploying a Caché mirror does, however, require significant planning, and involves a number of different procedures. And like any other critical infrastructure component, the operating mirror needs ongoing monitoring and maintenance." Given that I simply need to keep two globals in sync the Export/Import process seems much faster that what is described by this mirroring quote. 

 "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.

@Alexey Maslov The ultimate goal is to create identical globals on 2 different machines with a single run, on demand.  I can run code on the first machine, then export global creating code which changes regularly, reconnect the Studio to a different machine, import code, then run it again. This is decidedly not a single run. I can also export and import global too, of course. I am willing to learn functionality that would be faster to deploy than these two approaches. Ideally as fast as ZN which unfortunately works on the same machine only but I might be wrong about that.