Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi.
I have an issue with my understanding of persistence of properties. I have defined properties for several different things as being persistent. Nevertheless, after a reboot of the OS running the TWX platform, the values of those properties get vanished. My understanding is, that this shouldn't be - otherwise why should I mark something to be persistent? Or do I understand the implementation of the persistence not correct?
This happened with 5.1 and 5.3.
Edit
: I have the "feeling" that if a property was defined on shape or template level, the value on for individual thing persists. But if the property was defined on the thing level, that the value gets lost. Could it be a bug?Thanks.
Rayed
Solved! Go to Solution.
Update:
The problem has vanished by itself (more or less). When the problem existed I had the repository on the same partition like the installation (Linux).
Now I have created own partitions for the repositories and mounted/linked them to the primary one. Also I have moved the repository to the new partitions.
After restarting ThingWorx the "lost" data was there again! So the data was still in repository but for whatever reason hidden to be accessed..... Strange.
But now it works without problems.
Hi Polina.
This is strange. So I had definitely create the properties fresh every time. And in my 5.3 instance it is reproducible:
Any values on properties which where defined on thing level gets deleted after a restart.
Any values on properties which where defined on template or shape level are persistent.
I will follow your recommendation and will open a ticket.
Thanks for your effort.
Rayed
Hi Rayed what are the Base Types of your properties?
Hi Polina.
The base types are different. The first time I've encountered this was for a infotable property. But the last instances were String properties.
I've understood now from you, that my understanding of persistence is not wrong, so that the problem resides in my installation of TWX. I will check again and maybe reinstall the platform.
Many thanks.
Rayed
Great, do keep in mind that Infotable properties do not persist unless you write the whole property.
ie me.Infotableproperty.AddRow() will not persist.
You need to do
var temp = me.Infotableproperty
temp.AddRow()
me.Infotableproperty = temp
Update:
The problem has vanished by itself (more or less). When the problem existed I had the repository on the same partition like the installation (Linux).
Now I have created own partitions for the repositories and mounted/linked them to the primary one. Also I have moved the repository to the new partitions.
After restarting ThingWorx the "lost" data was there again! So the data was still in repository but for whatever reason hidden to be accessed..... Strange.
But now it works without problems.
hello,have you found the reason of this problem? I have encounted a problem like this one.When i used a script(in service or subscription) to set the property value.For example,Property(Num1),service js(me.Num+=1;).After i restart tomcat or the os,the property value can't persistent(return to 0).
I use the service js(me.Num+=1;) to set Property(Num1),is that some thing like your script that can't persist the property value?
"
do keep in mind that Infotable properties do not persist unless you write the whole property.
ie me.Infotableproperty.AddRow() will not persist.
You need to do
var temp = me.Infotableproperty
temp.AddRow()
me.Infotableproperty = temp"
You shouldn't have an issue if you are just setting a Property of BaseType number.