Transactions : diagram vs model

Hi, we have four simple transactions in our application.

  1. updating node data
  2. deleting node
  3. changing links (from one parent to another )
  4. removing links

As per the documentation, all of the above code should be inside a transaction.
But should we use the transaction on diagram or model?
In one of your comments , i can see the below quote

“why don’t you remove the Links from the Diagram instead of removing the link data from the Model”

So, where do i find the information on ‘differences between diagram transactions and model transactions’ and ‘when to use what’?

below are the example code that we use,

Update Node

                let node = diagram.findNodeForKey(key);

       = data.title;
       = data.description;
       = data.type;
       = data.status;


Delete Node


The transaction methods on Diagram and Model are the same: they both call the corresponding methods on the model’s UndoManager.

We could have required you to call the methods on the UndoManager, but it’s just a convenience that you can call them on whichever object is handy, model or diagram.