Hi Chi Wan,

Do you want to try calling IRIS directly using POSTMAN with the same Basic Authentication credentials? Or has it been covered in your first scenario?


Thanks for your inputs, Dan, Joel. And you're right. Perhaps I was trying to look up a callback somewhat like %OnAfterCommit() instead.

Hi Yaron, thanks for giving a test with the code example above. And the statement you referred is indeed from the documentation.

Yet to me the "transaction" mentioned is a bit ambiguous. I would rather interpret it as an explicit transaction demarcated by a TSTART and a TCOMMIT (or TROLLBACK) in the calling method.

Let me continue with your example here. This time I would like to add TSTART and TCOMMIT for the scope of the transaction, and there in the transaction I would like to add and save the second object:

USER>s obj=##class(USER.TestClass).%New(), obj.Name="Name", sc=obj.%Save() w !,sc
USER>zw ^USER.TestClassD
USER>s obj=##class(USER.TestClass).%New(), obj.Name="Name2", sc=obj.%Save() w !,sc
USER>zw ^USER.TestClassD

And what I really expect to see is, the %OnSaveFinally() method of those 2 objects will be called at the point just after TCOMMIT in my example, not after their own %Save() respectively.

Joseph has no followers yet.
Joseph has not followed anybody yet.
Global Masters badges:
Joseph has no Global Masters badges yet.