What are the differences between a process private global and a percent variable? Basically I have some code running in an Ensemble operation that processes requests, and it needs access to pieces of data that are scattered throughout XData blocks in various classes. Rather than opening the XData object and deserializing the XML on each request, I opted to cache this data in a percent variable, something like:
set %MyVar(sub1,sub2) = myValue
Which works out nicely: it's accessible from any code invoked by the operation, it persists for as long as the operation is running, and I can clear it out by restarting the operation, if I need to change the XData, for example. However that got me thinking: I could get all that same behavior from a process private global. So how are PPGs and %-vars different? Why choose one over the other?