Question
· Feb 23, 2020

Cannot invoke %SYSTEM.OBJ.Load() by IRIS.ClassMethodStatusCode

trying import ClassDefinition File via <IRISClient.Ado.IRIS> result with error: 

InterSystems.Data.IRISClient.IRISException (0x80004005): Exception thrown on server (code = 1242) : <REMOTE EXECUTE INVALID WRITE>Load+19^%apiOBJ

running: IRIS for Windows (x86-64) 2020.1 (Build 197U) Thu Jan 23 2020 09:56:09 EST

am i missing something?

 

        public void LoadClass()
        {
            
            // import/ update <Installer.Package> to %SYS NameSpace
            using (var c = new IRISConnection("SERVER=127.0.0.1;PORT=51773;NAMESPACE=%SYS;USER ID=_system;PASSWORD=SYS;"))
            {
                c.Open();
                var iris = IRIS.CreateIRIS(c);
                var fp = @"c:\tmp\DbNameSpace.cls";
                var qspec = "";
                var errs = "";
                var loadeditems = "";
                var parameter = new object[]
                {
                    fp, qspec,errs, loadeditems
                };
                try
                {
                    iris.ClassMethodStatusCode("%SYSTEM.OBJ", "Load", parameter);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
                iris.Close();
            }

        }

Discussion (5)3
Log in or sign up to continue

thanks; that did the job...

... and i guess you're right with what you say - for my perspective this behaviour is somehow strange; Shouldn't then InterSystems add a "dummy device" on calling methods to avoid these kind of exceptions? 

Never before i had a problem like that calling e.g. LoadMethod and for my sight it's a bit irritating that InterSystems expect me to know if a method i'll call will write to a "not allowed device" and to investigate how to trick that away