Skip to main content

Problem:

Under .Net you can use COBOL rununits to isolate COBOL working storage between concurrently running sessions such as under ASP.Net and other multi threaded environments.

Under rununits you can also use COBOL .Net classes and use static data. Static data can be delared as:-

       class-id. Class1 as "CLASSTEST.Class1".

       environment division.

       configuration section.

       repository.

      

       static.

       data division.

       working-storage section.

       01  WS-STATIC-DATA  PIC X(100).

When this class is added to a rununit is static data isolated to the rununit ?

Resolution:

No it is not.

Under .Net static data in a COBOL class is shared within the AppDomain.  It is therefore not isolated and should not be used to store intermediate values in a multi-user application using rununits.

Multiple rununits can all access the same static data. You could consider moving the data to object data which is then local only to the instance of the COBOL object.

Old KB# 1488