1 2 Previous Next 15 Replies Latest reply: Sep 22, 2011 5:21 AM by PeterGC RSS

    Fast Refresh in API Consolidator Oracle Lite

    PeterGC
      Good morning,

      We have the publication items with the option "Complete Refresh".

      Now we want to change this option for "Fast Refresh".

      I have been looking at the API, and the only function that lets me change is "recreatePublicationItem".


      There is some other function?

      Regards.
        • 1. Re: Fast Refresh in API Consolidator Oracle Lite
          winnie.hu
          Hi PeterGC,

          MDW can facilitate the work you want to do. Below are the steps:
          1. Make sure to completely synchronize your client data to the back-end oracle database, because below operation will lose any change which has not yet been synchronized to oracle database.
          2. Using MDW to create a project and do the following:
          - Pick up your publication which including the concerned complete refresh publication item and backup it's query statement;
          - Drop the concerned publication item, and re-create a new one based on the same base table and use the same query you backed up previously, specify the publication item as fast refresh which you mentioned in your post you wanted to.
          - Using the package wizard to publish your publication to the mobile server.

          That should work.

          BTW, using msync program, you can specify to do a complete refresh sync for a fast refresh publication item.

          Winnie Hu
          Oracle Berkeley DB and Oracle Lite Development
          winnie.hu at oracle dot com

          Edited by: winnie.hu on Sep 14, 2011 1:44 AM
          • 2. Re: Fast Refresh in API Consolidator Oracle Lite
            PeterGC
            Hi Winnie Hu,

            Thank you for answering so quickly.

            We want to do with Oracle Lite API. You know those roles?

            One question, if we change now sync mode Fast Refresh, can I lose data?

            Regards
            • 3. Re: Fast Refresh in API Consolidator Oracle Lite
              winnie.hu
              Hi PeterGC,

              APIs can also take care of dropping a specific publication item from a publication, creating a new publication item and adding it to the publication.

              To guarantee no data will get lost during the change, following below steps:
              1. Run sync after you made any modification to the client database;
              2. Make sure MGP has finished a run cycle after you uploaded your client modification, and check the repository via mobile manager that your publication item(s) don't have data remained in the In-Queue.

              Winnie Hu
              Oracle Berkeley DB and Oracle Lite Development
              winnie.hu at oracle dot com
              • 4. Re: Fast Refresh in API Consolidator Oracle Lite
                PeterGC
                Hi Winnie Hu,

                You think you use the "recreatePublicationItem" there may be a problem?

                Regards
                • 5. Re: Fast Refresh in API Consolidator Oracle Lite
                  winnie.hu
                  Hi PeterGC,

                  It should also work.

                  Winnie Hu
                  Oracle Berkeley DB and Oracle Lite Development
                  winnie.hu at oracle dot com
                  • 6. Re: Fast Refresh in API Consolidator Oracle Lite
                    PeterGC
                    There is no specific function to change that option, right?
                    • 7. Re: Fast Refresh in API Consolidator Oracle Lite
                      winnie.hu
                      Hi PeterGC,

                      Please refer to the javadoc for method ConsolidatorManager.reCreatePublicationItem()

                      -----
                      Re-creates a publication item. If the publication item is already added to publication(s), it will remain so after it's re-created.
                      -----

                      Winnie Hu
                      Oracle Berkeley DB and Oracle Lite Development
                      winnie.hu at oracle dot com
                      • 8. Re: Fast Refresh in API Consolidator Oracle Lite
                        PeterGC
                        Hi Winnie Hu,

                        I saw Winnie Hu, but believed there was a specific function to change that option, but did not find.

                        Thank you very much for your help, I will test the function.

                        Regards.
                        • 9. Re: Fast Refresh in API Consolidator Oracle Lite
                          PeterGC
                          Hello everyone,

                          I have been testing the API function "recreatePublicationItem" to change the option of a publication item: "Complete Refresh", to "Fast Refresh".

                          This option has helped me because it makes the recreation of the publication item also the customer, and lost the test data that was on the client.

                          Does anyone know of any other way to change the sync option?

                          Thank.

                          Regards
                          • 10. Re: Fast Refresh in API Consolidator Oracle Lite
                            winnie.hu
                            Hi PeterGC,

                            After recreate the publication item, please reset the metadata cache, and also make sure the same client you used before will still subscribe to the same application (which will include the same publication), then sync with the same client username, only if your data is still in the oracle database's base table, you should not lose anything.

                            Winnie Hu
                            Oracle Berkeley DB and Oracle Lite Development
                            winnie.hu at oracle dot com
                            • 11. Re: Fast Refresh in API Consolidator Oracle Lite
                              PeterGC
                              Thank you, Winnie Hu

                              Also for answering quickly.

                              I will try what you say, and will comment the results.

                              Thank you very much again

                              Regards
                              • 12. Re: Fast Refresh in API Consolidator Oracle Lite
                                gwilkinson
                                Not used the recreate publication API, but if it does what it is supposed to do, then it sounds like it retains the same internal table ids rather than generating new ones which would be the case for a drop and recreate.

                                complete and fast refresh items however have structural differences in the mobile schema and the parent databse, and this may cause you some issues. can get similar issues when changing the PKs for fast refresh items as well

                                complete refresh items do not have the same contraints on primary key uniqueness and have no out queue tables, they also do not generate the log, version control tables in the base application schema or any of the triggers used to trigger the MGP processing. On the client side the way data is applied to the database is also different.

                                Any action that changes the tableid will definitely lose any data from the client (you will see upload rows with blank object names, but record counts and sizes whilst the sync is ongoing, and these will disappear when it is completed).

                                Ideally you should ensure that all clients do two syncs in quick succession to force the upload and make sure that the out queues are cleared before making any changes, but this is not always feasible. It is possible to enable the server side trace logging and this will secure the upload files themseleves that can then be parsed manually to recover the data, but whilst possible, this is a complex process involving decoding the packed binary files. If you have any control over the client application where it is possible to change the client table names, then you can add the new publication item so both old and new run in parallel until all data is uploaded and then drop the old items
                                • 13. Re: Fast Refresh in API Consolidator Oracle Lite
                                  PeterGC
                                  Hello everyone,

                                  Thank you very much for the advice GaryW.

                                  But then how can we change the option "Complet Refresh" to "Fast Refresh" wit the API?

                                  Thank, regards.
                                  • 14. Re: Fast Refresh in API Consolidator Oracle Lite
                                    gwilkinson
                                    To check out if recreatepublicationitem will work without data los, do the following IN TEST ENVIRONMENT
                                    1) select from the mobileadmin repository table C$ALL_PUBLICATIONS where NAME=the PI name (or STORE=the table name) - this will tell you the ID for the publication item and also the PMODE of the item
                                    2) use the consolidatormanager ReCreatePublicationItem method, NAME being the publication item name (not the table name), PMODE=F - NOTE you may want to change the SQL as well. It sounds like you have already tried this before, but looking to see the effects
                                    3) redo the query from 1. If the PMODE has changed to F and the ID is unchanged then you should be able to manage the clients. If the ID has changed (i think it may well do), then you will need to plan the data recovery from the clients as sync will lose data.
                                    4) if the ID is unchanged in 3, then check that you have tables CMP$<PI name> in the mobileadmin repository schema, and tables CLG$<table name>, CVR$<table name> and triggers on the base table in the main application schema. If these are not all there, the change will not have worked correctly
                                    5) worth checking tables C$ALL_SUBSCRIPTIONS and C$ALL_CLIENT_ITEMS for one of your users, to make sure that they are instantiated correcly and have the PI

                                    If the table id changed in step 3, then the ONLY option you have is to
                                    a) ensure that all client devices run MSYNC twice in short succession
                                    b) either run the ReCreatePublicationItem or (since it does not achieve what you want) may be simpler to run DropPublicationItem and CreatePublicationItem as they are easier to manage.
                                    c) get the clients to MSYNC again to update the client database and load the data (first use even though marked as fast refresh will do a complete refresh of the publication item)
                                    1 2 Previous Next