The GoView.NewLinkPrototype is copied twice for a user’s link-drawing gesture. The first time is to create a prototype link object that is shown and modified while the user is dragging the mouse. The second time is to create the actual link that is connected to the ports and added to the document.
Of course the second copy might not happen because the user cancels the link or because no link is valid at the mouse point.
The prototype link is not modified to be connected to the two ports before the link is copied. The GoToolLinkingNew tool needs to copy the link before connecting its ports.
The GoView.LinkCreated event happens after the link has been copied, connected to the ports, and added to the document.
I think the concept that you are looking for is that only after an object has been added to a document you might consider persisting information about it. If some code makes a bunch of copies of a node, or if some code creates a bunch of new nodes by calling the constructor, that doesn’t mean much, if anything. It’s only when there is a relationship between newly created objects and existing “known” objects, such as when an object is added to a document or is linked to it somehow, that the new object can really have any “meaning”.
In your case, you might also need to worry about what happens when a link is relinked, if that is permitted in your application.
I suspect you need to worry about the structural and referential integrity of your objects during CopyObject, and worry about persistence at a separate/later time. The latter usually happens just when a document is saved or when a GoDiagram transaction completes.