9 Replies Latest reply on Oct 8, 2016 1:39 PM by pchung RSS
    rayedh Apprentice

    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

      • Persistence of Thing Properties
        polinao Ninja

        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.

         

          • Persistence of Thing Properties
            rayedh Apprentice

            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

             



              • Persistence of Thing Properties
                paic Collaborator

                Hi Rayed what are the Base Types of your properties?

                 

                  • Persistence of Thing Properties
                    rayedh Apprentice

                    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

                     



                      • Persistence of Thing Properties
                        paic Collaborator

                        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



                          • Persistence of Thing Properties
                            rayedh Apprentice

                            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.

                             



                              • Re: Persistence of Thing Properties
                                qliu Newbie

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

                              • Re: Persistence of Thing Properties
                                qliu Newbie

                                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"