Highlighted
Absent Member.
Absent Member.
1354 views

Multiple issues using C# .NET using CVM() on 8.1.2

[Migrated content. Thread originally posted on 05 January 2012]

Is the CVM() singleton? As in, you can only have a single instance of this object? I've attempted to create multiple objects, but when I 'think' I have 2 instances of the object it appears to really only be a single object.

I'm able to work around it by just accessing a single COBOL program at a time, but I'm curious if this is a limitation.

Also, I'm having a performance problem with using this on a server. On my development workstation, the response time is rather decent. When I deploy my solution to a test server, requests that were taking 10-14 seconds balloon up to several minutes. The requests complete if I turn off the timeout features, so I know I'm not having a security problem with file access. I also removed the network from the equation by moving the files all onto the same directory to be sure I wasn't seeing network lag as a problem.

I've tried to use the following to attempt to use the debugging features that are suppose to be built into the object, but I can't seem to find the right combination to get those features working. They are commented out now, but if someone knows where I'm going wrong there, perhaps I can move forward and figure out what is causing my issues on the server.

public errorTypes ErrCode;
private CVM COBOL = default(CVM);
try
            {
                if (COBOL == null)
                {
                    COBOL = new CVM();
                }

                //COBOL.ListConfig = true;
                //COBOL.ExtendedError = true;
                //COBOL.ZipErrorFile = true;
                //COBOL.ErrorsOut = "\\\\server\\wwwroot\\test\\error123.txt";
                //COBOL.TerminalOut = "\\\\server\\wwwroot\\test\\error123.txt";
                //COBOL.ErrorsOut = "";
                //COBOL.Switches = "-lxe \\\\server\\wwwroot\\test\\tracefile2.txt";
                //COBOL.Initialize();
                //COBOL.
                COBOL.Debug = false;
                COBOL.ConfigFile = ConfigFile;
                //COBOL.Debug = true;
                //COBOL.ExtendedError = true;
                COBOL.RunPath = RunPath;
                COBOL.Cache = false;
                //COBOL.Initialize("-lxe");
               
            }
            catch (Exception ex)
            {
                // Create a file that catches the exception
            }
        }


Thanks, Martin
0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Multiple issues using C# .NET using CVM() on 8.1.2

Yes, CVM is a singleton ... "CVM.jar" contains a singleton class, CVM, from
A Guide to Interoperating with ACUCOBOL-GT Chapter 2: Working with Java Technology > 2.2 Calling COBOL from Java
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Multiple issues using C# .NET using CVM() on 8.1.2

For the errors, what you are using looks unfamiliar, have you tried the methods decribed in

2.2.3 Using the Java API, "CVM.jar" >

2.2.3.1 CVM class

also on the terminal, it appeared that you are working on a web server "wwwroot" I don't think a terminal works in that way .. at any rate that option looked unfamiliar to me.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Multiple issues using C# .NET using CVM() on 8.1.2

shjerpe originally wrote:
For the errors, what you are using looks unfamiliar, have you tried the methods decribed in

2.2.3 Using the Java API, "CVM.jar" >

2.2.3.1 CVM class

also on the terminal, it appeared that you are working on a web server "wwwroot" I don't think a terminal works in that way .. at any rate that option looked unfamiliar to me.


Yes, this is on a web server running a WCF Service. I have a JavaScript client that calls the web service. The web service handles calling the COBOL code for me. Sorry, I think I had that in my post before I made an edit to it. We were attempting several combinations trying to get something to come out of it.

I didn't really think to look at the Java related items. I'll look at that documentation for more ideas.

Thanks,
Martin
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.