locked
sync framework repeatedly tries to download bad row RRS feed

  • Question

  • When doing a sync, the sync framework was trying to insert a row into the local database, but the insert was failing. The error message in the ApplyChangeFailed event indicated that the sync framework couldn't insert the row because some of the columns didn't allow nulls to be inserted. This was true. I am not sure how the sync framework determined that it needed to insert this row, but it did. What I am looking for is a way to tell the sync framework to discard that row or delete it or something. Is there a way to do that?

    I solved to problem locally by updating the table schema to allow nulls for those columns. Then the sync worked without fail. I then deleted the row from the local database and did another sync and now the problem row is gone. Obviously, this was a huge hack and I was able to do this in my dev environment, but what would be the proper way to handle a situation like this in production?

    GregP

    Friday, June 14, 2013 7:35 PM

All replies

  • check out conflict handling in the documentation. when sync framework is unable to apply a change, you have to tell it how to deal with it.
    Saturday, June 15, 2013 5:58 AM
  • June, thanks for your response. I have been doing that. In this case the conflict type is ErrorsOccurred and the sync framework is trying insert a row into the local table that does not even exist in the remote table. I don't understand how this could happen. As far as handling this conflict, what do I do? What I would like to be able to do is somehow tell the framework to ignore this row and quit trying to download it, but I don't see which action would do that.

    GregP

    Saturday, June 15, 2013 1:13 PM
  • so you're saying a row which doesnt exist from the source is being downloaded to the destination?

    looks to me like your tracking table is not in sync with its base table. if you're seeing phantom rows, did you by any chance deleted or truncated the source table and the triggers were not fired?

    Monday, June 17, 2013 1:11 AM
  • I guess that is what I am saying. I was updating the row on the source table, but I didn't notice if the trigger was fired or not. How can I resync the tracking table?

    GregP

    Monday, June 17, 2013 2:26 AM
  • am confused, you're saying the row doesnt exist on the source, so what are you updating then?
    Monday, June 17, 2013 2:54 AM
  • I had been updating it. I then began to believe that it was causing me problems so I deleted it hoping that would resolve my issue.

    GregP

    Monday, June 17, 2013 3:21 AM
  • so what's the conflict resolution you're setting?

    if the row has been deleted, it should be sending down a delete, not an insert.

    i suggest, you deprovision everything and start from scratch again to make sure you're tracking table entries is fresh.

    Monday, June 17, 2013 3:56 AM
  • Yes, but that is what was happening. In the ApplyChangeFailed event the conflict type was ErrorsOccurred and the error message was that the row was trying to be inserted but that was failing because there were nulls where nulls weren't allowed. I will try to deprovision and start from scratch and hope that will work and that should be fine in my development environment. What would you recommend if this were a production environment? If things do get out of whack in production, what kinds of things can you do to recover?


    GregP

    Monday, June 17, 2013 12:47 PM
  • I missed part of your question from your post. Currently I am not setting any conflict resolution. I am using the default which I believe to be Continue which of course doesn't work, but none of the other ones seem to apply either.

    GregP

    Monday, June 17, 2013 2:40 PM