Python call to Intersystems Cache class to get global sizes produces results and a failure code

Viewed 16

I am writing a Python tool to access an Intersystems Cache database (2018.1.x). I am using this import:

import intersys2.pythonbind3 as pyb 

connectivity:

self.conn   = pyb.connection()
self.conn.connect_now(f'{url}[{port}]:%SYS', userName, password,None)

# Create objects used to access cache/iris
self.db     = pyb.database(self.conn)

to get the global size:

# Clear byRef variables
allocated = 0
used      = 0
chkFlg    = False
nxGlobal  = "STRELPERF"
                
# Set args to pass by reference
list = [db,nxGlobal,allocated,used,chkFlg]

# exec the class method to get the global size
res = self.db.run_class_method("%Library.GlobalEdit", <db>,"GetGlobalSize")

But when I call the method:

status = self.genClassMethod('%SYSTEM.Status','IsError',[res])

Status always comes back as 1. But, for databases with the global the allocated and used sizes are returned with correct values even though a failure status is being returned. For cases where the status is failure but correct values are returned, the error text is (no error description)

How can this method produce valid results and return a failure code? What am I missing?

0 Answers
Related