Hello,
I'm trying to write a python action in which I need to make two commit. For that I tried to open two write transaction separately. My python code look like this:
class Action(Action):
@Action.action
def cb_action(self, uinfo, name, kp, input, output, trans):
# Open the first transaction
with ncs.maapi.single_write_trans(uinfo.username, 'python') as t:
root = ncs.maagic.get_root(t)
#First transaction code ....
t.set_comment("First commit")
t.apply()
# Open the second transaction
with ncs.maapi.single_write_trans(uinfo.username, 'python') as t1:
# Second transaction code ...
t1.set_comment("Second commit")
t1.apply()
The first commit take place successfully but the second one don't occur. I'm wondering why such behaviour is happenning and if there a way to fix it.
Thanks,