Maintaining job id through multiple webservice calls
I've run into an issue where job IDs are being retained through multiple calls. My team is doing a rewrite of our system that allows VB6 apps and web apps to directly interact with our Cache databases.
The new process has those applications calling into a WebAPI which then calls into the routines.
In one example of the issue we're having, the VB6 app calls into our api which then does the routine call. The Cache routine I'm working with has a load linetag that loads data into a temporary global called ^SORT($J). Upon completion, the process returns back through the api and the VB6 app. When the user decides to perform a Save, the app again calls into the api and then to another linetag of that routine that attempts to loop through ^SORT($J). The problem is that the 2nd call is coming in with a different job ID and therefore it can't see ^SORT($J from before and now we have bad data.
Is there any way to maintain a job ID through multiple calls like this? Before we moved to Cache, this app (and many others) worked as it maintained the state. Thank you!