1

Closed

Fail when I Try to sync deleted item

description

First of all, I want to thank you for sharing your excellent work.

I found some incidents that I would like to share with you, in case it is useful to you and other users

When I try to sync a deleted item, there is an exception "No such column new.id"​​. Debugging your code I noticed that the delete trigger, should be old.id instead of new.id
(SyncClient.Windows8 project, SQLiteHelper class, CreateTriggers & DeleteTombstoneTrackingEntities methods) The old.id patch doesn't apply to DeleteTombstoneTrackingEntities method

Another Issue that I have found, it's in the SyncServiceLib project, RequestProcessor class, GetSyncWriterWithContents method, i had to change a piece of code with the code suggested on this article http://social.msdn.microsoft.com/Forums/en-US/synclab/thread/7f2f54de-541c-4dbc-a77e-a7491782581d

Greetings from Montevideo, Uruguay.
Closed Sep 6, 2013 at 3:37 PM by Mimetis
Resolved in 3.8.0.2

comments

Mimetis wrote May 17, 2013 at 9:23 AM

Thx for your contribution !

I will fix the delete trigger an update the code as well.
For the Server part, i dont want to modify the original source code for the moment.

Again thank you for investing your time to resolve this issue !

Greetings from Paris, France ;)
Sébastien

Mimetis wrote Jun 5, 2013 at 3:11 PM

Finally, I ran into the same problem you faced.
I decided to implement the correct GetSyncWriterWithContents() method in this version

Sebastien

Eralp wrote Jul 31, 2013 at 7:04 AM

Hi Sebastien ,

At first thanks for your good work.

It's really helpfull but we've got some problems so We're trying to solve this problems..

1.As Montevideo said that , delete and update triggers are wrong.For Example :
//delete trigger problem
Begin
Update [GOLDEN_POINT_PHOTOS_tracking]
Set Oem_IsTombstone = 1, Oem_IsDirty = 1,
Oem_LastModifiedDate = DATETIME('now')
Where "LOGICALREF" = new."LOGICALREF" ;
End

IF you note that the fifth line , you'll see LOGICALREF (It's our PK) in double quotas and "new" keyword after equality symbol.Do not have these problems in the following example.Also update triggers like that..

Begin
Update [GOLDEN_POINT_PHOTOS_tracking]
Set Oem_IsTombstone = 1, Oem_IsDirty = 1,
Oem_LastModifiedDate = DATETIME('now')
Where LOGICALREF = old.LOGICALREF ;
End

For solution :
when my app is starting I delete your triggers and recreate them correctly..in the beginning I felt it's gonna be less painfull method for me..because of there is no code modification..

It works till delete an item from a table in sqlite..Delete is working but after do that , when I want to sync I'm getting an error.The Error is "no such column: new Microsoft.Synchronization.ClientServices.SQLite.TableMapping+Column".

by the way before sync I delete my triggers and load your triggers. (with double quotas edition :) )

After getting this error I checked my SQL Server tables , sync is working but I checked CacheRefreshStatistics result everything is 0..

What do you think about the result ?Can you give me an advice ?

thanks for all.

PS: Sorry for my english.

CacheRefreshStatistics resultForSync = null;
            try {
                resultForSync = await SyncContext.Current.Sync();
                TxtStat.Text  = "Başlangıç Zamanı : "   resultForSync.StartTime   " - "   Environment.NewLine;
                TxtStat.Text  = "Bitiş Zamanı     : "   resultForSync.EndTime   " - "   Environment.NewLine;
                TxtStat.Text  = "TotalChangeSetsDownloaded     : "   resultForSync.TotalChangeSetsDownloaded   Environment.NewLine;
                TxtStat.Text  = "TotalChangeSetsUploaded     : "   resultForSync.TotalChangeSetsUploaded   Environment.NewLine;
                TxtStat.Text  = "TotalDownloads     : "   resultForSync.TotalDownloads   Environment.NewLine;
                TxtStat.Text  = "TotalSyncConflicts     : "   resultForSync.TotalSyncConflicts   Environment.NewLine;
                TxtStat.Text  = "TotalSyncErrors     : "   resultForSync.TotalSyncErrors   Environment.NewLine;
                TxtStat.Text  = "TotalUploads     : "   resultForSync.TotalUploads   Environment.NewLine;
                TxtStat.Text  = ">>>>>>>>>>>>"   DateTime.Now   ">>>>>>>>>>>>"   Environment.NewLine;
            }
            catch (Exception ex) {
                txtBekle.Text = "Sync İşlem Hatası (a) > "   ex.Message;
                TxtStat.Text  = "!!!!!!!!!!!"   txtBekle.Text   Environment.NewLine;
            }

maxi_1972 wrote Aug 7, 2013 at 4:14 PM

Mimetis, when new release new version ?
thanks!