You need to conduct a transaction around all of the changes that you want to consider as a single operation. Don't do sequential StartTransaction/CommitTransactions.
However, it's OK to nest transactions, if your code happens to be implemented that way. But you need the single top-level transaction to make when making changes.
In your case I assume you are splicing a node "into" a link. That means adding a node, deleting the old link, adding two links, and connecting the two links with the original ports and with the new node. Or some apps would prefer not to delete the original link but to reconnect it, thereby keeping its data -- so you would only add one link.