cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Persistence of Thing Properties

rhawa
8-Gravel

Persistence of Thing Properties

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

1 ACCEPTED SOLUTION

Accepted Solutions
rhawa
8-Gravel
(To:paic)

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.



View solution in original post

9 REPLIES 9
posipova
20-Turquoise
(To:rhawa)

Hi Rayed,
I tried OS reboot, stopping and starting via tomcat; restarting tomcat itself. Values stayed untouched on both levels. Tested on 5.1 and 5.3. Was it a fresh first-time set up for every property, or did you delete-recreate them with the same name at some point prior to seeing the "defect" ? 
If you are entitled to support, I would recommend to open a ticket for further investigation.

rhawa
8-Gravel
(To:posipova)

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



paic
1-Newbie
(To:rhawa)

Hi Rayed what are the Base Types of your properties?

rhawa
8-Gravel
(To:paic)

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



paic
1-Newbie
(To:rhawa)

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



rhawa
8-Gravel
(To:paic)

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.



qliu1
1-Newbie
(To:rhawa)

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).

qliu1
1-Newbie
(To:paic)

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"


PaiChung
22-Sapphire I
(To:qliu1)

You shouldn't have an issue if you are just setting a Property of BaseType number.

Top Tags