Skip to main content
1-Visitor
March 22, 2017
Solved

Thing properties not stored (values are reset when thing is saved)

  • March 22, 2017
  • 11 replies
  • 6942 views

Hi,

I just noticed that the latest property values of my things are not saved anymore. If I e.g. change them using the thing UI in the editor I can change the values and I can see that they are changed but when I press Save the values are reset back to 0 or to an empty string. The same happens if the property are inherited from a shape or created for that thing. Also saving the values using a service has the same result.

The values seem to be stored in the associated value stream, though. Just the current / latest values seem to disappear.

Any pointers? Should the server (Tomcat) be rebooted?

TW version: 7.2.5-b56

-Risto

Best answer by jkaczynski

Hello Risto Vaaraniemi​,

If you leave aspect Persistent to false, the value is cached in the memory, so every time the memory is cleared, value gets back to the default one. To persist the current value across, you need to set aspect Persistent to true in the property edition panel, e.g.:

Hope it helps.

Regards,

J.

11 replies

5-Regular Member
March 22, 2017

Hi Risto, how is the Aspect for the property setup? Is it persistent?

1-Visitor
March 22, 2017

Hello Risto Vaaraniemi​,

If you leave aspect Persistent to false, the value is cached in the memory, so every time the memory is cleared, value gets back to the default one. To persist the current value across, you need to set aspect Persistent to true in the property edition panel, e.g.:

Hope it helps.

Regards,

J.

1-Visitor
March 23, 2017

Thanks for the answer. I'll try that.

What is the situation when the property should not be persistent? I'd assume that in normal cases people might want to retain the latest value of the thing properties, so the persistence probably should be on by default.

-Risto

1-Visitor
March 23, 2017

Hi Risto Vaaraniemi​,

I agree, that it could be a default set to true option. But there are also different situations, when you do not want to have this value stored, e.g. if you want to have only the most current values that comes from device. If device sends nothing, it should not be set.

From the Help Center:

Typically, it is best practice not to persist sub-second data changes (such as time series data stored in a ThingWorx data stream since streams are stored in a different area), but data that is required to be maintained over a system maintenance period should be persisted.

Please refer to: PTC.

I my previous answer was correct, please consider to mark it as a Correct Answer for the reference of other users.

Regards,

J.

1-Visitor
August 3, 2017

I have noticed the same bug.

On TW 7.1 when you set a property of a Thing A and then click save, property stays the same.

On TW 7.3 when I do the same property resets to default value chosen in its template. Worst thing is that when you save its template, the properties resets as well. Not cool. You dont want to add a property to a template and have all your properties in derived Things reset.

1-Visitor
August 3, 2017

Hi Jaroslav,

This is true even on latest 7.3.6 ( Released Today ) ?

It seems a major bug...

Carles.

1-Visitor
August 4, 2017

My version is 7.3.1.

And I am not sure if this bug was present from the start or if it occured after some time of using. I havent used it for some time. And there was a java update few days back.