SyncSession questions

Hi, i'm new to this SSCE but i'm interested of what it can do, so i did some readings and experimenting with different database, but i was hit by a problem and would like someone who's kind enough to explain to me.

do all syncsession's strings (SyncClientIdHash,SyncNewReceivedAnchor, etc) only supports lower case strings? Cos i'm currently experimenting it on Borland Interbase 2007 Dev edition, and i'm getting errors like "Unable to set session parameters in DbServerSyncProvider. Cannot obtain the value for command parameter : SYNC_LAST RECEIVED_ANCHOR." (when i used uppercase like SyncSession.SyncLastReceivedAnchor.TOUPPER() ) or "Cannot find column sync_last_received_anchor" (when i didn't use uppercase). Are there any work around for this?

[785 byte] By [ThomasCWY] at [2008-3-7]
# 1


Hmm, Interesting... I expect it to fail. The system expects the same names as you see them as public properties of SyncSession interface.
I am curious to why do you call ToUpper() on the SyncSession.SyncLastReceivedAnchor?

Thanks

RafikRobeal at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Microsoft Synchronization Services for ADO.NET...
# 2
well.. it's because of interbase's sql format, by default every word is converted to uppercase when passed to the server, for example
" select * from table1 where update_timestamp <> : sync_last_received_anchor"
will be read as
"SELECT * FROM TABLE1 WHERE UPDATE_TIMESTAMP <> : SYNC_LAST_RECEIVED_ANCHOR",
that's y i used ToUpper() on syncSession.synclastreceivedanchor because interbase is case sensitive, and it treats : SYNC_LAST_RECEIVED_ANCHOR and : sync_last_received_anchor as different parameters. That was 1st attempt before i realized that syncsession can only recognize lowercase strings .So i force interbase to read a column name as lowercase, i need to use double quotes for both side, the sync service can't recognise SyncLastReceivedAnchor with double quotes added to it.

@"SELECT * FROM TABLE1 WHERE UPDATE_TIMESTAMP <> :""sync_last_received_anchor"""

incInsOrdersCmd.Parameters.Add(string.Format (@":""{0}""", SyncSession.SyncLastReceivedAnchor), BDbType .TimeStamp ); (if i don put quotes, it's automatically converted to uppercase again")
So I'm still stuck with this .

Thanks for the quick reply, very much appreciated.

ThomasCWY at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Microsoft Synchronization Services for ADO.NET...
# 3


Good point. Thanks for clarifying this.
I think we need to handle this in the runtime. I cannot think of a workaround. I will take care of it.


Thanks

RafikRobeal at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Microsoft Synchronization Services for ADO.NET...
# 4

Hi,

Is SyncLastReceivedAnchor set on per table or per database basis?

In ohter words if I synchronize one table now, and then another table later will I miss the changes made to the second table

before I synced the first table?

Thanks

AlekseyS at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Microsoft Synchronization Services for ADO.NET...
# 5

Hi Aleksey,

The client provider stores an anchor for each table to address the scenario you just pointed out.

One important thing you to note here is that tables with relationships (pk-fk) should synchronize together as a group this is to avoid constraint failures.

Thanks,

Rafik

RafikRobeal at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Microsoft Synchronization Services for ADO.NET...
# 6

Great!

Thanks for fast response.

AlekseyS at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Microsoft Synchronization Services for ADO.NET...

Visual Studio Orcas

Site Classified