Lifecycle of a Node in Server-SDK

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
meh
Jr. Member
Jr. Member
Posts: 2
Joined: 16 Oct 2017, 18:15

Lifecycle of a Node in Server-SDK

Post by meh »

Hello, I have a question regarding the lifecycle of a node in the server-sdk:

Assuming an object with a HasComponent reference to a variable. The variable is not being referenced elsewhere.
When deleting the underlying object using BaseNodeManager.DeleteNode(...), will the variable still be "alive"?
I checked this by deleting the object and afterwards tried to add a new reference on another object to this abandoned node. I was surprised this to be working.
So, when is a node really considered to be decoupled/disposed from the sdk? What is the lifecycle of a node? This is important to know when making structural changes to the server while it is already up and running...

thanks for helping
Hartmut

User avatar
Support Team
Hero Member
Hero Member
Posts: 3070
Joined: 18 Mar 2011, 15:09

Re: Lifecycle of a Node in Server-SDK

Post by Support Team »

Hello,

If a complex object or variable is created, the children defined by the TypeDefinition are created automatically. If a node is deleted, these automatically created nodes are deleted, too.
In addition you can set the ParentAsOwner property of the CreateInstanceSettings to 'true'. In this case a "root-node" is also deleted when the parent is deleted.
Please see ParentAsOwner.
Best regards
Unified Automation Support Team

Post Reply