Oasis Montaj gxpy edb.lock() issue

Hi All. I am trying to write a custom coordinate conversion as n extension in Python. I am coming across an error where I get the current edb and lock it to create a db handle to read and write data in to the database. My code looks like this (for testing this error only).

def rungx():
gxpy.utility.check_version("9.2")

def rungx():
gxpy.utility.check_version("9.2") with gxpy.gx.gx():

edb = gxapi.GXEDB.current() # current edited database

try:
gdb = edb.lock() # lockedb, get GXDB handle

if gdb is None or gdb.is_null():
gxpy.utility.display_message(
"Lock_EDB returned an invalid database handle."
)
return

Any clues as to why I can not lock the edb to get a db ahndle would be appreciated.

Tagged: