Question
· Jun 13

Python interaction with Config.config class not returning gmheap size

I am trying to extract GMHeap, Locksiz values form Config.config using python (imported irisnative for Python) but the below python progam is not returning any value. Please suggest if i am doing any mistake - 

Also, plese suggest how i can set values for GMHeap and Locksiz to a different value through Python.

 

 

import irisnative

hostname = "127.0.0.1"
port = 1972
namespace = "%SYS" #change the namespace based on situation
username = "_SYSTEM"
password = "xxxxxxxx"
connection = irisnative.createConnection(hostname, port, namespace, username, password)
dbnative = irisnative.createIris(connection)

gmheap_size=dbnative.classMethodValue("Config.config", "gmheap")
print(gmheap_size)

connection.close()

Discussion (7)2
Log in or sign up to continue

Hi,

I tried updating the python script like below -

import irisnative

hostname = "127.0.0.1"
port = 1972
namespace = "%SYS" #change the namespace based on situation
username = "_SYSTEM"
password = "xxxxxxxx"
connection = irisnative.createConnection(hostname, port, namespace, username, password)
dbnative = irisnative.createIris(connection)

cfg=dbnative.classMethodValue('Config.config', 'Open')
print(cfg.get('gmheap'))

connection.close()

and i am getting the below error when i attempting to run python -

    print(cfg.get('gmheap'))
AttributeError: 'str' object has no attribute 'get'

i tried methog gmheapGet() for the property gmheap but i am not getting any output. This Config.config is persistent class and SQL table. is that is the reason 'classmethovalue' not working? the same code worked for getting %system.config.sharedmemoryheap.recommendedsize.