Does anyone know cases where changes to a static classes pro

Posted by mopfer on 24-Feb-2016 13:29

We have an OpenEdge REST service with methods that are accessed in instances of singleton classes that were generated from PDSOE.  In the methods of those singleton instances, we call some .ps and also use some ABL objects.  We call the same programs from other applications with no unusual behavior, but in this configuration we are seeing scoping issues with static classes and global variables.

What we see - at the beginning of the method we call a .p that changes three things:

1 is a public property in a static class that is used to make session information available to all ABL class-based objects in the session.

2 is a global shared variable that is used to make session information available to all .ps running in the session

3 is an update to a record in a temp-table record in a super-procedure that is used to make session information available to any process in the session that asks for it.

When the .p is done, the changed value from #3 is visible to the singleton instance that made the call and to all other processes that are called from the singleton instance after that.  The changed values from #1 and #2 are NOT visible to the singleton instance at that point, nor or they visible to any processes that are called from the singleton instance after that.

This seems to us like it should be impossible, but it is happening.  Does anyone have an explanation of how or why that would happen? 

We haven't been able to recreate the situation outside of our application, so we're thinking we've done something that we need to change, but taking pieces away from the singleton class until there is nothing left but the call to the .p and some code to see if the values are visible has not made the behavior change.

Thanks,

Mark Opfer

DMSi Software

All Replies

Posted by Laura Stern on 25-Feb-2016 08:41

Just to make sure I know what you're saying:

- In #1, I presume you mean this is a public static property.  There is actually no such thing as a static class, only a class with static properties and/or methods.

- In the paragraph after #3 you say "... nor are they visible to any processes ...".  Do you really mean processes here? Or did you mean procedures?

Can you please share the relevant code (pared down if possible) so we can see what it is doing.  Thanks.

Posted by Laura Stern on 25-Feb-2016 08:51

I've just learned that you have opened a support case for this. That's good.  So it's best if you just work through the tech support engineer from now on rather than continue this forum conversation.  I'll probably be involved in it anyway :-)

Posted by mopfer on 25-Feb-2016 10:29

Thanks Laura.  The code related to the question has been attached to the support case, and we'll work with them.

This thread is closed