8 Replies Latest reply on Jul 1, 2010 7:19 AM by JZ

    ManualSync using Data Modeling




      Currently I'm trying to use manual synchronization on a service generated through a Fiber Data Model but I can not get it to work.


      Using the "selector" approach, the DataService receives all updates and not just the one it is subscribed to.


      Trying to use "subtopics" does not work because the destination used for the service does not allow subtopics. Does anyone know how to enable manual synchronization when using Data Modeling? Or how to set the <allow-subtopics>true</allow-subtopics>-property for the destination?


      The documentation on Data Modeling keeps refering to 'manual synchronisation' as an option, but I cannot get this to work properly.


      The current code for the producer:

                               service.autoSyncEnabled = false;

                               service.autoCommit = false;


                              service.serviceControl.manualSync.producerDefaultHeaders = { group_id : _object.group_id };
                              service.createObject( _object );





      And for the consumer:

                          service.autoSyncEnabled = false;


                          service.serviceControl.manualSync.consumerSubscriptions = new ArrayCollection( [ new SubscriptionInfo( null, "group_id = '" + _group_id + "'"  ) ] );
                          service.serviceControl.addEventListener(MessageEvent.MESSAGE, handleMessage );


                          // get all available objects in the selected group, and keep the group up-to-date using manual synchronisation

                          service.getObjectsInGroup( _group_id );


      Looking at the messages received through the handleMessage-method, messages for all 'objects' are being passed and not just for the ones mentioned in the selector-string.


      Any help would be greatly appreciated!




        • 1. Re: ManualSync using Data Modeling
          JZ Adobe Employee

          Hi Rogier,


          Would you please post the model?  I am a little confused about what you are doing.  You are using DataManagement(DMS) feature with data syncronization but it seems you really need the Messaging instead.  I don't think there is any selector or subtopic for DMS.



          • 2. Re: ManualSync using Data Modeling
            Oorburg Level 1

            Hi JZ,


            I don't think the actual model matters much in this case. The only important thing is that the <auto-sync-enabled> property is set to false for the Entity.

            This causes LCDS to stop auto-updating changes for this entity, though the changes should still be accesible by manually syncing the data.

            As it says in the documentation:


            "To eliminate this overhead entirely, you set DataService.autoSyncEnabled to false on the client, and either manually refresh clients or use the manual synchronization feature to route changes to clients."


            I have used this before (both with DMS and with Messaging) and it always worked fine. I just can't get the generated dataservice to sync manually...





            PS: the code in my first post is for trying to keep a group up-to-date, without needing to cache or keep indices etc. on the server for the possibly large dataset...

            • 3. Re: ManualSync using Data Modeling
              JZ Adobe Employee

              Hi Rogier,


              The model is really important here for me to understand the relationship here.  Without it, I have to guess what you have and it will delay how fast we can reach the answer.    Anyhow, couple questions for you.



              1.  what is the relation of group and object here? Is it a one-to-many?  Does the object have a group association with Group entity?

              2.  what is the getObjectsInGroup method? It is a custom fill?  What is the relation between this and the producerDefaultHeaders?

              3.  can you turn on  Endpoint debug logging and post the console output?  Something like this,


                  [11:17:05.585 Deserializing AMF/RTMP request Version: 3  null 2.0

                (Command method=null (0) trxId=2.0)


                  (Typed Object #0 'flex.messaging.messages.CommandMessage')

                    operation = 11

                    correlationId = ""

                    timeToLive = 0

                    messageId = "ECDD399C-9E9B-BCCE-4920-7F220FAFC987"

                    timestamp = 0

                    headers = (Object #1)

                      DSEndpoint = "qa-rtmp-ac"

                      DSId = "4F62233E-BE2F-1554-4716-648A8655994F"

                      DSAddSub = (Array #2)

                        = "_;_state_id = 'MS'"

                    destination = "people.State"

                    body = (Object #3)

                    clientId = "EB993F01-DD2F-5137-A807-7F220451CD7F"




              • 4. Re: ManualSync using Data Modeling
                Oorburg Level 1

                Hi John,


                The model used contains the following entity:


                    <entity name="Object" persistent="true">
                        <annotation name="ServerProperties">
                            <item name="ServerType">LCDS</item>
                        <annotation name="DMS">
                            <item name="Table">objects</item>
                            <item name="cache-items">false</item>
                            <item name="auto-sync-enabled">false</item>
                        <id name="ID" type="integer"/>

                        <property name="some_property" .... >
                        <property name="group_id" type="integer"/>

                        <filter name="getObjectsByGroupID" criteria="group_id ="/>


                The filter "getObjectsByGroupID" is used to get some of the objects from a very large dataset of objects. Autosync is disabled to relieve the server of all the administration needed to manage this large dataset.

                The client calling the filtermethod would still want know if more corresponding objects are added to the fill. A selector (or subtopic) on the ManualSyncConfiguration should suffice. The behaviour I'm seeing is that the dataservice in the client receives all additions of new objects and not just the ones with the correct group_id. Debugging the received messages reveals that their headers have been properly assigned, but no selection has taken place.


                So my question remains: should ManualSync using a selector work for a generated dataservice? & is there a way to enable subtopics on the server when using a fiber destination?




                • 5. Re: ManualSync using Data Modeling
                  JZ Adobe Employee

                  Hi Rogier,


                  I have reproduced the problem and logged as a bug for LCDS (2653964).




                  • 6. Re: ManualSync using Data Modeling
                    AnilKrc Level 1

                    Hi Rogier,


                    If this is a blocker for your application, please request Adobe support for a patch.



                    • 7. Re: ManualSync using Data Modeling
                      Oorburg Level 1

                      Thanks you guys. Let's hope this will be fixed soon.

                      Is there a way to track the bug-report?


                      Kind regards,


                      • 8. Re: ManualSync using Data Modeling
                        JZ Adobe Employee

                        No, the LCDS bug system isn't available public yet.  Contacting our support team might be the best choice for now.