Skip to main content

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

  • January 6, 2012
  • 3 replies
  • 0 views

[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

3 replies

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 6, 2012

[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
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

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 6, 2012

[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
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.

  • Author
  • Rocketeer
  • 19312 replies
  • January 6, 2012

[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
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