Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Synchronizaton Log Redux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Synchronizaton Log Redux

    I just realized I asked this exact question about 5 years ago, but was hoping Alpha has provided some additional information about how the synchronization log feature works.

    I have a disconnected mobile app that started to leave duplicate records on the server when it synched. I turned on the synch log feature and most of them stopped, but there are still a few duplicates being created every once in a while. I'd therefore like to know exactly how this log works so I can track down the cause of the problem (it might be something my app is doing). The best I can find is exactly the same information that appeared when I asked the question the last time. Alpha uses the log to prevent duplicates and it somehow involves the client app firing an additional callback after it gets a response from the server. I tried to figure out how this works but I can't seem to do it: For example, suppose the client app sends a new record to the server, to be added to the database. The record of course has no primary key (we use AI Numeric PKs). The server adds it and then adds a record to the log, including the new AI primary key. The server also sends a message back to the client, but if the client has in the meantime lost its connection it never receives that message. So no additional callback is fired and the server knows this. But now suppose the client adds another record and sends another package to the server. In particular, the server receives two records with blank primary keys, one the original that the server has already added and the other a completely new one. How does the server use the log to figure out WHICH record was the one it previously added to the database?

    The above is of course a long way of asking if anyone has any idea how this synch log table actually works (i.e. if any new information has been released). I can't find anything new via Google search or search of these Boards.

    As an aside, I HAVE checked the "Clear log table...." option in Project Properties but find (as best I can determine) that Alpha does not clear it, it just keeps getting larger. Of course that's of secondary concern.

    Thanks in advance for any (new) ideas.



    Norman

    #2
    I would un-check "Clear log table". Alpha states this gives you a little added protection against duplicate updates an inserts. Perhaps it is possible that the server sends a message to the client that the sync was successful and then clears the log table, but the client doesn't receive the message to tries to sync the same records again. Since they are missing from the sync log table you get duplicates. You can handle the sync log table growing too big by writing a procedure in your database to clear out older records.

    Comment


      #3
      Well, as I say, even though "Clear log table" is checked Alpha does NOT appear to be doing that. It seems no entries are ever erased as the table keeps growing bigger.

      I realize nothing is perfect and the log table does seem to help somewhat; do you recall offhand where you read (or heard) that Alpha recommends unchecking this option, that it will give a more protection against duplicate updates? I don't remember seeing anything like that. Regardless, I still don't see how a log table would protect against duplicate inserts. There seems no way Alpha can tell by looking at the log table and a newly submitted record if that specific record was already added (at least that's my assessment).

      Thanks for your post, I'd love to read something about the logic behind this technique.

      Comment


        #4
        When you go into your list, on the Detail View tab, and you click on the property "Clear sync log table after successful sync". You'll notice the hep at the bottom of the page says "For added protection against duplicate updates and inserts you can uncheck this property."

        In my log table it inserts a Primary Key. My understanding has always been if the client attempts to insert that record again for the same RowGUID, it will not insert it because the log indicates that the insert has already happened. If the client then updates the record, it will get a new RowGUID and therefore be able to be updated on the server. These are just my assumptions however. I never really looked into it too deeply.

        Comment


          #5
          Ahh, the onscreen help. Thanks, Alpha has so much of this sort of stuff stuck in all different parts of the UI I'm sure I miss at least half of it. That's one of the things I really like about developing with it.

          You bring up the Row GUID, which is something I see in the log but don't know anything about. How does using it differ from using the primary key? If it's generated on the client THEN I can see Alpha being able to detect a duplicate add, if on the server I still don't see it. Regardless, I will search for Row GUID and see what I can come up with.

          BTW, I just spied a YT video on synchronization, maybe that holds the "key".

          Comment


            #6
            Yes Row GUID is generated on the client. For troubleshooting purposes you can add it to your list. Just add a new Virtual Javascript field to the list, and then use code similar to the following
            Code:
            if(data.hasOwnProperty('*rowGUID')){
            return data['*rowGUID'];
            }
            My guess is that you need the rowGUID for two reasons. One is that you likely have multiple lists in your app synching to multiple tables in your database. Since the log makes no mention of table name, a Primary Key alone would not be helpful since different tables might use the same Primary Key. Secondly, the sync log also has to handle updates. What if you insert a record, the primary key gets added to the log, and then you update the record on the client. The only way the for the log to know that the client has updated the record and it is not a duplicate of the first insert is for the client to assign a new row GUID after every update.

            Well hope this has been helpful to you. Good luck.

            Comment


              #7
              It has. Thanks.

              Comment

              Working...
              X