<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The Synchronizer : SyncServices</title><link>http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx</link><description>Tags: SyncServices</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>What’s new in Sync Services for ADO.NET 2.0?</title><link>http://blogs.msdn.com/synchronizer/archive/2007/12/13/what-s-new-in-sync-services-for-ado-ne-2-0.aspx</link><pubDate>Fri, 14 Dec 2007 01:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6765630</guid><dc:creator>Rafik</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/6765630.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=6765630</wfw:commentRss><description>&lt;p&gt;As you know we’ve released the V1.0 of Sync Services for ADO.NET as a standalone package. It is also bundled with Visual Studio 2008 with additional Sync Designer experience. Sync Services is one component in a comprehensive sync platform offering from Microsoft called Microsoft Sync Framework that we unleashed recently. The Sync Framework is publicly available as an early &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&amp;amp;displaylang=en" class="" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&amp;amp;displaylang=en"&gt;CTP&lt;/a&gt; release. With it, you will find a new version of Sync Services for ADO.NET that adds on top of V1 components a new provider called DbPeerSyncProvider. Well, let’s talk a little bit about this new guy.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;DbPeerSyncProvider Overview&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Sync applications tend to evolve over time; let’s say you started by adding offline capabilities to your application, your customers loved it, but then they ask for more. They wanted to have the same experience on the device; well, no big deal, you tweaked your app to work on devices as well as desktop. Both flavors of your app take data offline and synchronize with some useful service you have on the cloud. Now, some savvy customers will come to you and say, “My data plan is expensive, can I synchronize my mobile device with the desktop instead of going to the web?” others might say, “we need to be able to synchronize with one another in an ad-hook fashion!” ... So now you have a growing demand to support a different model than that of a central server database. You need to build peer to peer sync system. Your central database will become yet another peer(s) in an ever growing topology!&lt;/p&gt;
&lt;p&gt;This scenario is not uncommon, but technology seems to lack big time when you move to loosely-coupled multi master sync scenarios. This is where DbPeerSyncProvider comes in to fill this gap.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;b&gt;DbPeerSyncProvider Architecture&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;You will feel at home when looking at the DbPeerSyncProvider interface. It follows the same programming model introduced with DbServerSyncProvider. Let’s see what commands we have on the provider and sync adapter:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;i&gt;Provider Commands&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The provider interface contains thee commands that you need to define. These commands are used by the provider to manage key information about this node including metadata summary for the contents on this node. This summary is formally known as ‘knowledge’ object in the sync framework. Using the knowledge object, one can tell very quickly if two nodes are in sync or not. The provider commands are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SelectScopeInfoCommand&lt;/li&gt;
&lt;li&gt;UpdateScopeInfoCommand&lt;/li&gt;
&lt;li&gt;SelectNewTimestampCommand &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The ‘scope’ refers to the set of tables that this provider synchronizes. A given node could have multiple scopes. This is similar to the table group concept in the client\server provider terminology.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;b&gt;&lt;i&gt;Adapter Commands&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Each adapter represents a table in the scope on the node. The sync adapter interface carries nine commands that can be further categorized as follows:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://blogs.msdn.com/synchronizer/attachment/6765630.ashx" title="Peer Sync Adapter Commands" style="width: 507px; height: 463px;" alt="Peer Sync Adapter Commands" mce_src="http://blogs.msdn.com/synchronizer/attachment/6765630.ashx" height="463" width="507"&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change Enumeration&lt;br&gt;Just one command is used to enumerate incremental changes from the database. This is different from the DbServerSyncProvider where we have three commands instead.&lt;br&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Change Application&lt;br&gt;As you might expect, there are three commands for applying inserts, updates and deletes. In addition there is another command for getting a hold of a given row or its metadata. This command is mostly used during change application.&lt;br&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Tombstone Cleanup&lt;br&gt;The peer provider needs to record in its summary the fact that tombstones have been deleted. That said, the provider will use this command in which you, the developer, defines the criteria for deleted rows to be cleanup (tombstones older than 10 days, for example), to find those tombstones and record the needed metadata for you then delete the rows. No worries, this command is just a simple select statement, the provider will do the heavy lifting for you.&lt;br&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Metadata Management&lt;br&gt;In the p2p sync world, metadata is king! By this statement I am trying to underline the importance of the metadata management and the ability of the provider to tweak them as it sees fit. There are three metadata management commands that give the provider the control to insert, update and delete metadata for a given row.&lt;br&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;This just a quick introduction to our new provider, there is a lot to talk about as we move forward with building sharing applications using this provider. Check out the documentation on the &lt;a href="http://www.msdn.com/sync" class="" mce_href="http://www.msdn.com/sync"&gt;sync dev center&lt;/a&gt;, and give the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&amp;amp;displaylang=en" class="" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C88BA2D1-CEF3-4149-B301-9B056E7FB1E6&amp;amp;displaylang=en"&gt;bits&lt;/a&gt; a test drive! &lt;/p&gt;
&lt;p&gt;More to come…&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;. See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" mce_href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Myrtle Beach&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" title="best hotels in nyc" mce_href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in NYC&lt;/a&gt;,&lt;a href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" mce_href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/fl/orlando/kid-friendly-hotels-in-orlando/l1653c16" title="kid friendly hotels in orlando" mce_href="http://www.raveable.com/fl/orlando/kid-friendly-hotels-in-orlando/l1653c16" style="color: rgb(0, 101, 226);"&gt;Kid Friendly Hotels in Orlando&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-diego/top-10-hotels-in-san-diego/l568c3" title="top 10 hotels in san diego" mce_href="http://www.raveable.com/ca/san-diego/top-10-hotels-in-san-diego/l568c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in San Diego&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;I am not actively blogging about Sync Technologies. Please see&amp;nbsp;&lt;a href="http://blogs.msdn.com/sync/" class="" mce_href="http://blogs.msdn.com/sync/" style="color: rgb(0, 101, 226);"&gt;Sync Team Blog&lt;/a&gt;&amp;nbsp;for more updated content.&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6765630" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/synchronizer/attachment/6765630.ashx" length="27809" type="image/gif" /><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Stay Away From Auto Increment Columns </title><link>http://blogs.msdn.com/synchronizer/archive/2007/06/28/stay-away-from-auto-increment-columns.aspx</link><pubDate>Thu, 28 Jun 2007 20:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3587448</guid><dc:creator>Rafik</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/3587448.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=3587448</wfw:commentRss><description>&lt;p&gt;I had few &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1643465&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1643465&amp;amp;SiteID=1"&gt;conversations&lt;/a&gt; on the sync services forum about that ability to synchronize a table with auto-increment column, also known as identity column, as the primary key or unique id for the row. It is rather common to see this pattern of primary key set to auto increment integer type in every table and then establish foreign key relationships across different tables in the database. Unfortunately, auto-increment columns are not designed with sync in mind.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Unique ID&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Before we go any further, let me state this clearly that &lt;i&gt;&lt;b&gt;&lt;u&gt;sync services must be able to uniquely identity each row undergoing sync. By definition, the unique key must not be reintroduced in the system by any other node&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;You might get the feeling that this requirement is too restrictive and it would hinder many scenarios. Well, you will be surprised to know that this is such a basic requirement that all sync and replication systems are built upon! For example, Merge replication adds a GUID column to every table it synchronizes, you cannot delete that column (try it); file replication service in windows uses FID that NTFS generates to uniquely identify each file; active directory replication requires a GUID for every object …etc&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;b&gt;Data Caching Scenarios&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;For download only or caching scenarios where the data is cached on the client for easy reference, there is no problem in synchronizing auto increment columns. This is because the server is the only node generating row IDs which is guaranteed to be unique across the system. Clients are not changing the data thus eliminating any ID collisions.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;b&gt;Bidirectional Sync Scenarios&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;When you have many clients generating same ID and uploading data to the server, the problem manifests itself clearly. Many clients will end up generating a row with ID of 17, for example. These rows are actually different objects yet have the same identity.. This scenario does not work. I know some people tried few tricks to get this scenario to work, which I acknowledge is possible for simple cases, but once you add foreign key relationships to the mix the complexity will shot high up, take my word for it.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;b&gt;Possible Solutions&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Use Unique Keys&lt;br&gt;&lt;/u&gt;The best solution and will save you a lot of effort on the long run, is to eliminate the risk of reusing the same key elsewhere in the system by generating a globally unique key for every new row. Few ideas of a unique key generation:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Use Guid&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Use a hash of machine unique MAC address&amp;nbsp; + local incrementing number (i.e. timestamp, or application controlled number)&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;&lt;u&gt;Online Insertions&lt;/u&gt;&lt;br&gt;If the row inserts goes to the server directly then the server will be the only node that generates IDs which guarantees uniqueness. That said, if you must use auto-increment columns and your clients does not make inserts very often, then you might want to consider making inserts directly to the server database followed by a sync to get the rows back to the client database. Updates and deletes will remain offline.&lt;br&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div mce_keep="true"&gt;&lt;u&gt;ID Ranges&lt;br&gt;&lt;/u&gt;This is the same technique used by merge replication today. It defines a unique range of IDs for each client and thus avoids any overlaps between clients. Sync Services allows you to do that only once when the schema is created on the client. Unlike merge, clients cannot go back to the server to request a new range. This might be addressed in future versions of the sync services based on the feedback we receive from developers.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;This is a important problem for us and we are looking into addressing this in future versions with new and innovative techniques but for now try to avoid auto increment columns for your offline applications.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;. See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" mce_href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Myrtle Beach&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" title="best hotels in NYC" mce_href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in New York City&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" mce_href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-kitchen" title="hotels with kitchen or kitchenette" mce_href="http://www.raveable.com/hotels-with-kitchen" style="color: rgb(0, 101, 226);"&gt;Hotels with a kitchen or kitchenette&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-francisco/top-10-hotels-in-san-francisco/l717c3" title="top 10 hotels in san francisco" mce_href="http://www.raveable.com/ca/san-francisco/top-10-hotels-in-san-francisco/l717c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in San Francisco&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3587448" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Sync Events for Conflict Handling, Progress Reporting, Business Logic …</title><link>http://blogs.msdn.com/synchronizer/archive/2007/06/06/sync-events-for-conflict-handling-progress-reporting-business-logic.aspx</link><pubDate>Wed, 06 Jun 2007 18:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3119480</guid><dc:creator>Rafik</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/3119480.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=3119480</wfw:commentRss><description>&lt;p&gt;Let me just say that&amp;nbsp;synchronization services eventing model is so rich. It is designed to enable you to build many of the features that business applications demand. Some of those features that come to mind are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Monitoring and progress reporting&lt;/li&gt;
&lt;li&gt;Conflict detection and resolution&lt;/li&gt;
&lt;li&gt;Tracing and debug logging&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Business logic&lt;/li&gt;
&lt;li&gt;Auditing&lt;/li&gt;
&lt;li&gt;Schema creation tweaks&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;So what are those events that I am talking about? well,&amp;nbsp;let me&amp;nbsp;go through them here. To begin, I'd like to divide the events into two categories, provider events and agent events.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;u&gt;Sync Provider Events&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;b&gt;Change Enumeration Events&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;SelectingChanges&lt;/i&gt;&lt;/u&gt; - This event is fired prior selecting changes in any of the tables in a group. The event is at group level.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;ChangesSelected&lt;/i&gt;&lt;/u&gt; - This event is fired after the provider concludes enumeration of changes for all the tables in the group. This event is at group level.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Change Application Events&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;ApplyingChanges&lt;/i&gt;&lt;/u&gt; - This event is fired prior applying changes in any of the tables in the group. The event is at group level. You can access the changes dataset through this event and apply any kind of business logic your scenario demands.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;ChangesAppliedEvent&lt;/i&gt;&lt;/u&gt; - This event is fired after the provider concludes application of changes for all the tables in the group. This event is at group level. The dataset of changes along with the set of conflicts encountered while applying are also available from the event arguments. This way you could log them to a file for auditing or tracing purposes.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;ApplyChangeFailed&lt;/i&gt;&lt;/u&gt; - This event is fired when an attempt to apply a row resulted in a failure. This event is at row level.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Progress Event&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;SyncProgress&lt;/i&gt;&lt;/u&gt; - This event is fired at the table level after selecting changes from a given table. The event is also fired at the row level after applying a given row.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Schema Creation Events&lt;/b&gt; (Client Provider only)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;CreatingSchema&lt;/i&gt;&lt;/u&gt; - This event is fired prior to creating table schema on the client database. This event is at the table level. The schema is represented by a DataSet object and using this event you could tweak the schema definition if needed.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;SchemaCreated&lt;/i&gt;&lt;/u&gt; – This event is fired after creating a table on the client database. This event is at the table level. The connection and transaction objects are also available through this event so that you could execute extra commands in the same transaction. This is useful in case you want to add an index or a constraint to the table that just got created.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br&gt;&lt;b&gt;&lt;u&gt;Sync Agent Events&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;b&gt;Session Events&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;SessionProgress&lt;/i&gt;&lt;/u&gt; – This event is fired in the context of Synchronize() call. It fires at pre-defined checkpoints in the synchronization process: reading metadata, creating schema, uploading changes, downloading changes and writing metadata. If you are trying to show synchronization progress&amp;nbsp;bar in a form, for example, then this event is the one you would want to use.&lt;/li&gt;
&lt;li&gt;&lt;u&gt;&lt;i&gt;SessionStateChanged&lt;/i&gt;&lt;/u&gt; – This event is fired to indicate the state of the agent session which is either ready of synchronizing. The event is fired in the context of Synchronize() call.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br&gt;As you can see, you have many points to plug in your code and perform myriad of tasks while synchronization is in progress. Many of these events were driven by the experience we have working with SQL Server merge replication customers. I'd be interested to know what you think and if these events would help you building your custom logic.&lt;/p&gt;
&lt;p&gt;One final note before&amp;nbsp;I go is that&amp;nbsp;not all the events listed here are available in the current beta 1 bits; few are coming up in&amp;nbsp;beta 2.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews.&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ny/new-york-city/romantic-hotels-in-nyc/l5039c2" title="romantic hotels in nyc" mce_href="http://www.raveable.com/ny/new-york-city/romantic-hotels-in-nyc/l5039c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in NYC&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" mce_href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" title="top 10 hotels in myrtle beach" mce_href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/il/chicago/kid-friendly-hotels-in-chicago/l2156c16" title="kid friendly hotels in chicago" mce_href="http://www.raveable.com/il/chicago/kid-friendly-hotels-in-chicago/l2156c16" style="color: rgb(0, 101, 226);"&gt;Kid Friendly Hotels in Chicago&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px; font-weight: bold;"&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room jacuzzi&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/fl/miami/best-hotels-in-miami/l1644c1" title="best hotels in miami" mce_href="http://www.raveable.com/fl/miami/best-hotels-in-miami/l1644c1" style="color: rgb(0, 101, 226);"&gt;&lt;b&gt;Best Hotels in Miami&lt;/b&gt;&lt;/a&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3119480" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Avoiding False Conflicts Resulting From Interrupted Sync</title><link>http://blogs.msdn.com/synchronizer/archive/2007/05/08/avoiding-false-conflicts-resulting-from-interrupted-sync.aspx</link><pubDate>Wed, 09 May 2007 01:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2489030</guid><dc:creator>Rafik</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/2489030.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=2489030</wfw:commentRss><description>&lt;p&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;A &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1568807&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1568807&amp;amp;SiteID=1"&gt;great thread&lt;/a&gt; on the sync services &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1"&gt;forum&lt;/a&gt; yesterday brought up this interesting question on what happens if the sync session is interrupted due to connection failure or client application crash …etc. To visualize the scenario in your mind, picture an n-tier sync app which uses a web service to upload changes to the server. At sync time, the web method was called to upload changes to the server; the server applies the changes but prior to returning to the client the connection was dropped. In this case, the client has not received the acknowledgement from the server and thus didn’t save the new sent anchor. In the next sync, the client will attempt to upload the changes that it sent last time along with any new changes to the server. Now, the question is how can you, the developer, deal with duplicate application of same rowa and what can the DbServerSyncProvider do to help you out?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;Let me answer this by going back to the tracking infrastructure that you have seen in the samples. Recall from the &lt;a href="http://www.syncguru.com/Projects.aspx" class="" mce_href="http://www.syncguru.com/Projects.aspx"&gt;demos&lt;/a&gt; that one of the tracking columns added on the server was originator_id column. This column records the id of the client which makes the last change to the row. If the change was done on the server (outside of sync), the value of this column is reset to the server id instead (which is typically 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;The originator_id column is needed for two reasons:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0.75pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;span style=""&gt;1-&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;Breaking the Loop&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;br&gt;Changes uploaded by a given client should not come down when the same client download changes. originator_id column helps you filter out those changes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0.75pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;span style=""&gt;2-&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;Interrupted Sync&lt;br&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;When the client app crashes or the connection to the server is dropped the sync is interrupted. Some of the in-flight changes might have been processed already but the sync anchor which is persisted after successful sync have not been saved yet which means that in the next sync some of the already-processed changes will be resent. This situation results in false conflicts.&lt;span style=""&gt;&amp;nbsp; &lt;/span&gt;However, you can avoid these conflicts using originator_id knowing that a client change cannot conflict with its own pervious change. In other words, if client A uploaded a change to row R, then the same change (or even new change) to R was uploaded again; there should be no conflict as long as the row on the server has A as the originator_id. If R was updated on the server (i.e. by different client) in the mean time, then conflict is unavoidable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;How can you implement this logic in your commands?&lt;br&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;br&gt;Actually, this logic is already implemented in all demos and also generated by the SyncAdapterBuilder. Here is a quick recap:&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;For update and delete commands, the where clause skips the conflict detection check (&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;update_timestamp &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&amp;lt;= &lt;span style="color: black;"&gt;@sync_last_received_anchor&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;) if the pervious originator_id is same as the synchronizing client (&lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;update_originator_id &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;= &lt;span style="color: black;"&gt;@sync_client_id&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;) as show below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;Update Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;update &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;[orders]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;set &lt;/span&gt;&lt;span style="color: black;"&gt;[order_date] &lt;/span&gt;= &lt;span style="color: black;"&gt;@order_date&lt;/span&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;"&gt;[update_originator_id] &lt;/span&gt;= &lt;span style="color: black;"&gt;@sync_client_id&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;where &lt;/span&gt;(&lt;span style="color: black;"&gt;update_timestamp &lt;/span&gt;&amp;lt;= &lt;span style="color: black;"&gt;@sync_last_received_anchor &lt;/span&gt;&lt;span style="color: blue;"&gt;or &lt;/span&gt;&lt;span style="color: black;"&gt;update_originator_id &lt;/span&gt;=&lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;@sync_client_id&lt;/span&gt;) &lt;span style="color: blue;"&gt;and &lt;/span&gt;&lt;span style="color: black;"&gt;[order_id] &lt;/span&gt;= &lt;span style="color: black;"&gt;@order_id&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;set &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;@sync_row_count &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;= &lt;span style="color: black;"&gt;@@rowcount&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;Delete Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;delete from &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;[orders] &lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;where &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;(&lt;span style="color: black;"&gt;update_timestamp &lt;/span&gt;&amp;lt;= &lt;span style="color: black;"&gt;@sync_last_received_anchor &lt;/span&gt;&lt;span style="color: blue;"&gt;or &lt;/span&gt;&lt;span style="color: black;"&gt;update_originator_id &lt;/span&gt;= &lt;span style="color: black;"&gt;@sync_client_id&lt;/span&gt;) &lt;span style="color: blue;"&gt;and &lt;/span&gt;&lt;span style="color: black;"&gt;[order_id] &lt;/span&gt;= &lt;span style="color: black;"&gt;@order_id&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;set &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;@sync_row_count &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;= &lt;span style="color: black;"&gt;@@rowcount&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;Insert Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: 'Arial','sans-serif';"&gt;There are two ways to avoid false conflicts when inserting a row:&lt;br style=""&gt;&lt;br style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 10pt 0.5in; text-indent: -0.25in; line-height: 115%;"&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;&lt;span style=""&gt;(1)&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;Optimistic:&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt; Let it fail hard and deal with the conflict later on (as explained below)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; text-indent: -0.25in; line-height: 115%;"&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;&lt;span style=""&gt;(2)&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;Pessimistic&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 9.5pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;: Before applying the insert, make sure that the row does not exist already. There is an obvious race condition between the first check and the insert though&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: 'Arial','sans-serif';"&gt;The demos typically show simple insert command. For interrupted sync scenario, the second insert of the same row will fail and throws exception; the DbServerSyncProvider will surface the error as ApplyRowFailedEvent. With this event you could decide to either skip the row or retry with the force write flag set. In the latter case, your command has to execute an update instead of insert when the flag is set, as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;if &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;@sync_force_wirte&lt;span style="color: blue;"&gt; = 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;insert into &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;[orders] &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;(&lt;span style="color: black;"&gt;[order_id]&lt;/span&gt;, &lt;span style="color: black;"&gt;[order_date]&lt;/span&gt;, &lt;span style="color: black;"&gt;[update_originator_id]&lt;/span&gt;) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;values &lt;/span&gt;(&lt;span style="color: black;"&gt;@order_id&lt;/span&gt;, &lt;span style="color: black;"&gt;@order_date&lt;/span&gt;, &lt;span style="color: black;"&gt;@sync_client_id&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;update &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;[orders]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;set &lt;/span&gt;&lt;span style="color: black;"&gt;[order_date] &lt;/span&gt;= &lt;span style="color: black;"&gt;@order_date&lt;/span&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;"&gt;[update_originator_id] &lt;/span&gt;= &lt;span style="color: black;"&gt;@sync_client_id&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;where &lt;/span&gt;(&lt;span style="color: black;"&gt;update_timestamp &lt;/span&gt;&amp;lt;= &lt;span style="color: black;"&gt;@sync_last_received_anchor &lt;/span&gt;&lt;span style="color: blue;"&gt;or &lt;/span&gt;&lt;span style="color: black;"&gt;update_originator_id &lt;/span&gt;= &lt;span style="color: black;"&gt;@sync_client_id&lt;/span&gt;) &lt;span style="color: blue;"&gt;and &lt;/span&gt;&lt;span style="color: black;"&gt;[order_id] &lt;/span&gt;= &lt;span style="color: black;"&gt;@order_id&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: 'Lucida Console';"&gt;set &lt;/span&gt;&lt;span style="font-size: 9pt; color: black; font-family: 'Lucida Console';"&gt;@sync_row_count &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: 'Lucida Console';"&gt;= &lt;span style="color: black;"&gt;@@rowcount&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.5pt; color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;o:p&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: 'Arial','sans-serif';"&gt;I tend to prefer the optimistic approach since such failures are typically very low percentage. However, the pessimistic approach would perform better if the probability of interruptions is high.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;. See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" mce_href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" mce_href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;b&gt;&lt;a href="http://www.raveable.com/fl/miami/top-10-hotels-in-miami/l1644c3" mce_href="http://www.raveable.com/fl/miami/top-10-hotels-in-miami/l1644c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Miami&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px;"&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room hot tub&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-francisco/kid-friendly-hotels-in-san-francisco/l717c16" title="kid friendly hotels in san francisco" mce_href="http://www.raveable.com/ca/san-francisco/kid-friendly-hotels-in-san-francisco/l717c16" style="color: rgb(0, 101, 226);"&gt;Kid friendly hotels in San Francisco&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt; &lt;br&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2489030" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Sync Services: When should you author your own table schema for your offline clients?</title><link>http://blogs.msdn.com/synchronizer/archive/2007/04/26/sync-services-when-should-you-author-your-own-table-schema-for-your-offline-clients.aspx</link><pubDate>Thu, 26 Apr 2007 04:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2278140</guid><dc:creator>Rafik</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/2278140.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=2278140</wfw:commentRss><description>&lt;p&gt;The question of creating the schema on the client store always pops up in almost any sync related conversation. Flexibility is desired but simplicity is a must! I can understand that and I believe that the sync framework has a good balance between both (feel free to tell me otherwise)…&lt;/p&gt;
&lt;p&gt;In one of my &lt;a href="http://blogs.msdn.com/synchronizer/archive/2007/02/28/sync-services-thoughts-on-schema-creation.aspx" class="" mce_href="http://blogs.msdn.com/synchronizer/archive/2007/02/28/sync-services-thoughts-on-schema-creation.aspx"&gt;pervious&lt;/a&gt; posts I touched on schema creation logic that is implemented by the DbServerSyncProvider today. Automatic generation of the schema based on the SelectIncrementInserts\Updates command provides the ‘simplicity’ aspect, while authoring the SyncSchema object and pass it to the provider reflects the ‘flexibility’ aspect of the framework. Now, I want to talk a little bit more about when you would want to author you own SyncSchema object:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Custom Schema Scenarios&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;Incomplete automatic schema creation&lt;br&gt;&lt;/u&gt;In some cases, the schema generated using the select command is not complete. This typically the case when ADO.NET provider for your backend database is unable to get needed schema information. For example, the Oracle ADO.NET provider does not return the precision and scale information for numeric columns. See for yourself how I addressed this in Oracle &lt;a href="http://www.syncguru.com/projects/SyncServicesDemoOracle.aspx" class="" mce_href="http://www.syncguru.com/projects/SyncServicesDemoOracle.aspx"&gt;demo&lt;/a&gt;.&amp;nbsp;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;&lt;u&gt;DataType mapping&lt;/u&gt;&lt;br&gt;Different database brands define different datatypes.Now, if you are using SqlCe on your offline clients, then you must somehow map forigen data types to those that SqlCe understands. You do that through SyncSchema.&lt;br&gt;&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Customizing the schema for each client&lt;/u&gt;&lt;br&gt;If you decided to implement some sort of identity ranges for your client such that each client new inserts will generate different identity value that is garanteeded to be unique, then you would need to customize the schema for each client. I should not that unlike SQL Server Merge Replication, sync services does not define a way to get a new range once the existing one expires. But anyways, you get the idea; if you need to pass some extra info for each client during schema creation you could author the schema yourself, or intercept the auto generated schema and edit it prior to passing it to the client.&lt;br&gt;&lt;/li&gt;
&lt;li&gt;&lt;u&gt;Custom server provider&lt;br&gt;&lt;/u&gt;If you don’t have access to the relational store directly (for example, you have to use API or web service to get to the data) or you have non-relational store and thus cannot use ADO.NET; you would need to implement a custom server provider. The only way to describe the schema for your clients in this case is through SyncSchema object.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;I should note that in the case you know the schema in advance and you are developing the client app too, then you have the option of just creating the tables on the client database when you app is setup or even ship the app with a SqlCe file that has the initial content which could include the schema along with some initial data or just the schema..&lt;/p&gt;
&lt;p&gt;This is a very rich topic and I think I will talk about it some more later on, stay tuned …&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews.&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" mce_href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" mce_href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;b&gt;&lt;a href="http://www.raveable.com/fl/miami/top-10-hotels-in-miami/l1644c3" mce_href="http://www.raveable.com/fl/miami/top-10-hotels-in-miami/l1644c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Miami&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-diego/kid-friendly-hotels-in-san-diego/l568c16" title="kid friendly in san diego" mce_href="http://www.raveable.com/ca/san-diego/kid-friendly-hotels-in-san-diego/l568c16" style="color: rgb(0, 101, 226);"&gt;Kid friendly hotels in San Diego&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-kitchen" title="hotels with kitchen or kitchenette" mce_href="http://www.raveable.com/hotels-with-kitchen" style="color: rgb(0, 101, 226);"&gt;Hotels with a kitchen or kitchenette&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/nv/las-vegas/5-star-hotels-in-las-vegas/l4839c15" title="5 star hotels in las vegas" mce_href="http://www.raveable.com/nv/las-vegas/5-star-hotels-in-las-vegas/l4839c15" style="color: rgb(0, 101, 226);"&gt;5 Star Hotels in Las Vegas&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2278140" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Sync Services: How to partition data for your offline clients?</title><link>http://blogs.msdn.com/synchronizer/archive/2007/04/07/sync-services-how-to-partition-data-for-your-offline-clients.aspx</link><pubDate>Sat, 07 Apr 2007 10:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2044060</guid><dc:creator>Rafik</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/2044060.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=2044060</wfw:commentRss><description>&lt;p&gt;Offline&amp;nbsp;clients are not born equal; one client would like to sync a lot of server data while another client might just wish for its small share of rows that pertains to the task at hand. Sync services framework recognizes the need for data partitioning and so in this post I’ll try to give some details on how to do that. Let’s start by identifying two type of partitioning: vertical and horizontal.&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;b&gt;Vertical Partitioning&lt;br&gt;&lt;/b&gt;&amp;nbsp;&lt;br&gt;In vertical partitioning a sub set of the columns is synchronized with the client application. So let’s say you have a table with 20 columns and you decided&amp;nbsp;to&amp;nbsp;select only 5 columns&amp;nbsp;for synchronization purposes. That can simply be achieved on the SyncAdapter commands for that table. Note that for bidirectional sync, columns that are not synchronized need to have either&amp;nbsp;a default value or the insert and delete commands would set the value for those columns using some custom logic. &lt;br&gt;&amp;nbsp;&lt;br&gt;To change the horizontal partitioning for different clients, your commands could find what type of client is synchronizing (manager, employee, etc) and branch to different column selection statement.&amp;nbsp;&lt;br&gt;&amp;nbsp;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;b&gt;Horizontal Partitioning&lt;br&gt;&lt;/b&gt;&amp;nbsp;&lt;br&gt;This is the more interesting one; let’s say that each sales person is assigned to a given state. In this case, sales person in state of CA would be interested to get the customer information located on that state and not the rest. This is also known as filtering. There are multiple ways to implement that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The assignment information is already known to the server, then the adapter commands can get the state value first for the synchronizing client and use it in the where clause of the select incremental commands.&lt;/li&gt;
&lt;li&gt;The client can pass the filter value to the server directly, this can be done using the CustomParameter collection on the SyncAgent interface. The parameter value is then sent to the server&amp;nbsp;during the sync session&amp;nbsp;and can be used directly in the where clause to partition the data.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;There are few interesting issues in this scenario though:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What if a customer relocated from CA to OR, how can that be reflected on the sales person overseeing CA? This goes back to the tracking infrastructure that you have on the server, your triggers can catch such update to the customer and record it such that the next time CA sales guy synchronizes he would see a delete for that customer info. The OR client won’t have any problem when the customer row surfaces in his partition.&lt;/li&gt;
&lt;li&gt;What if the sales person changes his coverage area from CA to OR? Well, the client application needs to reset its anchors and data, this can happen by simply deleting the database and let the client synchronizes again.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;This was just a quick overview; I am sure many of sync developers would need to do something along these same lines. Give it a try and post all your questions to the public &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1"&gt;forum&lt;/a&gt;, my blog, or &lt;a href="http://www.syncguru.com/Aboutme.aspx" class="" mce_href="http://www.syncguru.com/Aboutme.aspx"&gt;email&lt;/a&gt;. Have fun! &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews.&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ny/new-york-city/romantic-hotels-in-nyc/l5039c2" title="romantic hotels in nyc" mce_href="http://www.raveable.com/ny/new-york-city/romantic-hotels-in-nyc/l5039c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in NYC&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" mce_href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" title="top 10 hotels in myrtle beach" mce_href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/il/chicago/kid-friendly-hotels-in-chicago/l2156c16" title="kid friendly hotels in chicago" mce_href="http://www.raveable.com/il/chicago/kid-friendly-hotels-in-chicago/l2156c16" style="color: rgb(0, 101, 226);"&gt;Kid Friendly Hotels in Chicago&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px; font-weight: bold;"&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room jacuzzi&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/fl/miami/best-hotels-in-miami/l1644c1" title="best hotels in miami" mce_href="http://www.raveable.com/fl/miami/best-hotels-in-miami/l1644c1" style="color: rgb(0, 101, 226);"&gt;&lt;b&gt;Best Hotels in Miami&lt;/b&gt;&lt;/a&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2044060" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Deep in Sync: Handling PK-FK Constraints</title><link>http://blogs.msdn.com/synchronizer/archive/2007/03/24/deep-in-sync-how-sync-services-handle-pk-fk-constraints.aspx</link><pubDate>Sat, 24 Mar 2007 02:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1939627</guid><dc:creator>Rafik</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/1939627.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=1939627</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://www.blogger.com/profile/01700526164060680385" class="" mce_href="http://www.blogger.com/profile/01700526164060680385"&gt;Roger Jennings&lt;/a&gt; in his most recent blog &lt;a href="http://oakleafblog.blogspot.com/2007/03/sync-services-bidirectional-test.html" class="" mce_href="http://oakleafblog.blogspot.com/2007/03/sync-services-bidirectional-test.html"&gt;post&lt;/a&gt; asked an interesting question on how sync services deal with one-to-many relationship between tables undergoing synchronization? Roger is the most active blogger I know of and he is watching sync services closely. It is no secret that his blogs is one of my favorites. I check it at least once a day if not more! I cannot wait to see his upcoming article on sync services next May along with the test harness that he is working on. &lt;/p&gt;
&lt;p&gt;Now back to the question, the one-to-many relationship in relational databases is implemented as PK-FK constraint. In my &lt;a href="http://www.syncguru.com/Projects.aspx" class="" mce_href="http://www.syncguru.com/Projects.aspx"&gt;demos&lt;/a&gt;, I showed two tables but did not have PK-FK constraint established. The reason is that I wanted to do some rodom actions on the database and having such relation makes it rather complex (and I am lazy too ;-) ). I should consider fixing that in later demos though. &lt;/p&gt;
&lt;p&gt;So let’s imagine for a minute that ‘order_details’ table has a foreign key that references ‘orders’ table’s primary key. Now,&amp;nbsp; how sync services deals with such setup and will it be able to synchronize the data without constraint failures? The quick answer is yes, sync services is capable of dealing with PK-FK relationships between tables. However, as you experienced from the demos, the sync framework is very open model and correct implementation is required to get sync to work properly. To achieve that you need to understand few basic sync concepts. Nothing new here since the demos have already shown all that but did not elaborate on why they are needed; now it is the time to dive deep in sync:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Grouping PK-FK Tables Together&lt;br&gt;&lt;/b&gt;The framework provides SyncGroup type for this very reason. With SyncGroup, you instruct the runtime to move changes of set of tables as one unit. This is particularly important when the tables have PK-FK relationships. This way, FK rows in one table will go with their PK rows in the other table.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Tracking Row Creation&lt;br&gt;&lt;/b&gt;Recall that in all the demos I added ‘create_timestamp’ column on every table along with ‘update_timestamp’. ‘create_timestamp’ is needed to indicate when the row was created. This is important to distinguish inserts from updates but more importantly it guarantees that a given row will be enumerated as an insert even if it is beeing updated very frequently. That said, hot rows won’t escape enumeration at least once. This is critical for PK rows because its is required for subsequent FK rows.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Change Application Order&lt;br&gt;&lt;/b&gt;As you can see, the two things I mentioned above guarantees that PK-FK changes will either come togather in one dataset or at least PK rows will come before their FKs. The only thing left is to ensure that PKs are inserted prior to FKs. For deletes, FKs&amp;nbsp;are&amp;nbsp;deleted&amp;nbsp;first then PKs. This is done by the sync providers. On the client side, the order of SyncTable objects in the agent’s SyncTableCollection defines the order for applying inserts. On the server, the order of SyncAdapter objects in the provider SyncAdapterCollection defines the order for applying inserts. Deletes are applied in reverse order on both sides.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;Hopefully, I was able to give some insights on how the framework handles PK-FK relationships. I would encourage you to experiment&amp;nbsp;the scenarios you&amp;nbsp;have in mind and share your feedback with the sync team through the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1"&gt;forum&lt;/a&gt;.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;. See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" mce_href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Myrtle Beach&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" title="best hotels in NYC" mce_href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in New York City&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" mce_href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-kitchen" title="hotels with kitchen or kitchenette" mce_href="http://www.raveable.com/hotels-with-kitchen" style="color: rgb(0, 101, 226);"&gt;Hotels with a kitchen or kitchenette&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-francisco/top-10-hotels-in-san-francisco/l717c3" title="top 10 hotels in san francisco" mce_href="http://www.raveable.com/ca/san-francisco/top-10-hotels-in-san-francisco/l717c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in San Francisco&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1939627" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Sync Services: Thoughts on Schema Creation</title><link>http://blogs.msdn.com/synchronizer/archive/2007/02/28/sync-services-thoughts-on-schema-creation.aspx</link><pubDate>Wed, 28 Feb 2007 20:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1774837</guid><dc:creator>Rafik</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/1774837.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=1774837</wfw:commentRss><description>&lt;p&gt;In typical database to database sync scenarios where the backend database is SQL Server, the sync framework creates the schema for the tables undergoing synchronization on the client database. All that is needed is to have the &lt;i&gt;SelectIncrementalInsertsCommand&lt;/i&gt; or &lt;i&gt;SelectIncrementalUpdatesCommand&lt;/i&gt; supplied on the &lt;i&gt;SyncAdapter&lt;/i&gt; object corresponding to the table in question. The sync runtime queries the database for the schema and provide it to the client as a dataset. This logic also works with none SQL Server backend however this process is subject to failure. The reason is that the schema obtained from the server might, and most likely will, have different data types which SqlCe on the client does not know how to map to its &lt;a href="http://msdn2.microsoft.com/en-us/library/aa237850%28SQL.80%29.aspx" class="" mce_href="http://msdn2.microsoft.com/en-us/library/aa237850(SQL.80).aspx"&gt;supported data types&lt;/a&gt;. Even with SQL Server as the backend, some data types are not supported on SqlCe and will lead to the same failure.&lt;/p&gt;&lt;p&gt;In no so typical scenarios where the server is not a relational store, the runtime won’t be able to find the schema in the first place.&lt;/p&gt;&lt;p&gt;There has to be a way to address table schema creation issues. The &lt;i&gt;SyncServerProvider&lt;/i&gt; has a property called SyncSchema. This property is set to null by default. However, if your scenario fall one of the above scenarios, then you ought to take a look at the &lt;i&gt;SyncSchema&lt;/i&gt; type. &lt;i&gt;SyncSchema&lt;/i&gt; has the same look and feel of a &lt;i&gt;DataSet&lt;/i&gt; with few more additions to simplify setting up a table schema. By passing a &lt;i&gt;SyncSchema&lt;/i&gt; instance to the &lt;i&gt;SyncServerProvider&lt;/i&gt;, you explicitly disable the dynamic schema query logic and instruct the provider to pass your custom made schema instead. &lt;/p&gt;&lt;p&gt;While dynamic generation of schema is an attractive feature, it does not come for free. Therefore hand crafted &lt;i&gt;SyncSchema&lt;/i&gt; object is still a good practice even if there is no type difference issues between server and client tables.&lt;/p&gt;&lt;p&gt;More details on this topic later …&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="word-spacing: 0px; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;See Examples:&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" mce_href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/top-10-hotels-in-seattle/l7344c3" mce_href="http://www.raveable.com/wa/seattle/top-10-hotels-in-seattle/l7344c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/fl/miami/5-star-hotels-in-miami/l1644c15" mce_href="http://www.raveable.com/fl/miami/5-star-hotels-in-miami/l1644c15" style="color: rgb(0, 101, 226);"&gt;&lt;b&gt;5 Star Hotels in Miam&lt;/b&gt;i&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px; font-weight: bold;"&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room jacuzzi&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/anaheim/kid-friendly-hotels-in-anaheim/l751c16" title="family friendly hotels in anaheim" mce_href="http://www.raveable.com/ca/anaheim/kid-friendly-hotels-in-anaheim/l751c16" style="color: rgb(0, 101, 226);"&gt;Family Friendly hotels in Anaheim&lt;/a&gt;&lt;/b&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/fl/fort-lauderdale/best-hotels-in-fort-lauderdale/l1545c1" title="best hotels in fort lauderdale" mce_href="http://www.raveable.com/fl/fort-lauderdale/best-hotels-in-fort-lauderdale/l1545c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Fort Lauderdale&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;. Your feedback is welcome on&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1774837" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>A nice gift from SQL Server 2005 SP2 to sync developers</title><link>http://blogs.msdn.com/synchronizer/archive/2007/02/20/a-nice-gift-from-sql-server-2005-sp2-to-sync-developers.aspx</link><pubDate>Tue, 20 Feb 2007 22:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1729871</guid><dc:creator>Rafik</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/1729871.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=1729871</wfw:commentRss><description>&lt;p&gt;If you haven’t heard the news yet, &lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/servicepacks/sp2.mspx" class="" mce_href="http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/servicepacks/sp2.mspx"&gt;SQL Server 2005 SP2&lt;/a&gt; is out! Now if you are like me, thinking about data synchronization for the most part of your day, then you should be really excited about SP2. Let me tell you why. &lt;br&gt;&lt;br&gt;Recall that in all sync services demos in this blog, we used timestamp tracking column to know when the row was updated. This works fine if there were no uncommitted transactions on the SQL server backend. So what would happen if there was a pending transaction? Well, changes made in that transaction will not be enumerated by the SelectIncrememental commands, that’s expected since dirty data is not visible in read committed isolation level in which we typically operate. When the transaction is committed sometime later on, the timestamp value of the changed rows could be older than the one the client stores for the next sync. Timestamp value is captured at statement execution time and that poses the problem for our simple tracking approach. Basically, next time the client synchronizes it will miss those changes with older timestamp. This is not cool and not acceptable of course!&lt;/p&gt;&lt;p&gt;To clarify this point more, let’s look at a timeline diagram:&lt;br&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;img src="http://blogs.msdn.com/synchronizer/attachment/1729871.ashx" style="width: 580px; height: 253px;" mce_src="http://blogs.msdn.com/synchronizer/attachment/1729871.ashx" align="middle" height="253" width="580"&gt;&lt;/p&gt;&lt;p&gt;As the diagram shows, timestamp is monotonically increasing with every change made in the database regardless if the change is committed or not. Transaction T2 is committed therefore all its changes (from 53-68) are visible. Transaction T1 on the other hand has not committed yet, changes at 50, 51, 52 and 60, 61, 62, 63 are not visible. In the diagram, the sync request for a new anchor came back with timestamp value of 61; therefore all sync enumerations will go up until this point for committed rows only. After T1 commits, all its changes will be visible. In the next sync, changes from 61 to N (70 for example) will see T1 changes of 60, 62 and 63 but will miss 50, 51 and 52. Too bad!&lt;/p&gt;&lt;p&gt;But hey, sync team is part of SQL Server and the SQL engine guys are next door. So we asked politely, of course, for a little favor to somehow be able to get the timestamp of the oldest uncommitted transaction. Well, guess what? Our request was granted and SP2 has this little function (&lt;b&gt;min_active_rowversion&lt;/b&gt;())&amp;nbsp; for sync services developers. &lt;br&gt;Let’s put the new function to test. Below is a simple SQL commands to show the min_active_rowversion in action in the same database and table I used in the demos:&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: fuchsia;"&gt;min_active_rowversion&lt;/span&gt;&lt;span style="color: gray;"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: fuchsia;"&gt;@@DBTS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: fuchsia; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: gray;"&gt;*&lt;/span&gt; &lt;span style="color: blue;"&gt;from&lt;/span&gt; orders&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;begin&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: blue;"&gt;tran&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;insert&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: blue;"&gt;into&lt;/span&gt; orders&lt;span style="color: gray;"&gt;(&lt;/span&gt;order_id&lt;span style="color: gray;"&gt;,&lt;/span&gt; order_date&lt;span style="color: gray;"&gt;)&lt;/span&gt; &lt;span style="color: blue;"&gt;values&lt;/span&gt; &lt;span style="color: gray;"&gt;(&lt;/span&gt;5&lt;span style="color: gray;"&gt;,&lt;/span&gt; &lt;span style="color: fuchsia;"&gt;GetDate&lt;/span&gt;&lt;span style="color: gray;"&gt;())&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;insert&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: blue;"&gt;into&lt;/span&gt; orders&lt;span style="color: gray;"&gt;(&lt;/span&gt;order_id&lt;span style="color: gray;"&gt;,&lt;/span&gt; order_date&lt;span style="color: gray;"&gt;)&lt;/span&gt; &lt;span style="color: blue;"&gt;values&lt;/span&gt; &lt;span style="color: gray;"&gt;(6,&lt;/span&gt; &lt;span style="color: fuchsia;"&gt;GetDate&lt;/span&gt;&lt;span style="color: gray;"&gt;())&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;commit&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: blue;"&gt;tran&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The result I got on my test server is as follows:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table class="MsoTableLightGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr style=""&gt;&lt;td style="border-style: solid; border-color: black; border-width: 1pt 1pt 2.25pt; padding: 0in 5.4pt; width: 159.6pt; background-color: transparent;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;o:p&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: solid solid solid none; border-color: black black black rgb(225, 224, 210); border-width: 1pt 1pt 2.25pt medium; padding: 0in 5.4pt; width: 159.6pt; background-color: transparent;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;Select @@DBTS&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: solid solid solid none; border-color: black black black rgb(225, 224, 210); border-width: 1pt 1pt 2.25pt medium; padding: 0in 5.4pt; width: 159.6pt; background-color: transparent;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;Select min_active_rowversion()&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=""&gt;&lt;td style="border-style: none solid solid; border-color: rgb(225, 224, 210) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 159.6pt;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;Before Tran&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: none solid solid none; border-color: rgb(225, 224, 210) black black rgb(225, 224, 210); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 159.6pt;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;0x0000000000000BC4&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: none solid solid none; border-color: rgb(225, 224, 210) black black rgb(225, 224, 210); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 159.6pt;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;0x0000000000000BC5&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=""&gt;&lt;td style="border-style: none solid solid; border-color: rgb(225, 224, 210) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 159.6pt; background-color: transparent;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;Begin Tran + Inserting 2 rows&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: none solid solid none; border-color: rgb(225, 224, 210) black black rgb(225, 224, 210); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt; background-color: transparent;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;0x0000000000000BC6&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: none solid solid none; border-color: rgb(225, 224, 210) black black rgb(225, 224, 210); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 159.6pt; background-color: transparent;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;0x0000000000000BC5&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=""&gt;&lt;td style="border-style: none solid solid; border-color: rgb(225, 224, 210) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 159.6pt;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;Commit Tran&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: none solid solid none; border-color: rgb(225, 224, 210) black black rgb(225, 224, 210); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 159.6pt;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;0x0000000000000BC6&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-style: none solid solid none; border-color: rgb(225, 224, 210) black black rgb(225, 224, 210); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 159.6pt;" width="213"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: center;" align="center"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;font face="Times New Roman"&gt;0x0000000000000BC7&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Also try opening another query window to experiment when an older tran is committed the min_active_rowversion function will return the timestamp of the next oldest pending tran in line! Beautiful!&lt;/p&gt;&lt;p&gt;Back to sync services; to take advantage of this new function simply update the implementation of GetNewAnchorCommand on the server provider to “Select min_active_rowversion() - 1” with this little change you’ve solved a serious data consistency problem! Viva SP2!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="word-spacing: 0px; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" title="raveable hotel reviews" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews.&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;See Examples:&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" mce_href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/top-10-hotels-in-seattle/l7344c3" mce_href="http://www.raveable.com/wa/seattle/top-10-hotels-in-seattle/l7344c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;a href="http://www.raveable.com/fl/miami/best-hotels-in-miami/l1644c1" title="best hotels in miami" mce_href="http://www.raveable.com/fl/miami/best-hotels-in-miami/l1644c1" style="color: rgb(0, 101, 226);"&gt;&lt;b&gt;Best Hotels in Miam&lt;/b&gt;i&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-francisco/best-hotels-in-san-francisco/l717c1" title="best hotels in san francisco" mce_href="http://www.raveable.com/ca/san-francisco/best-hotels-in-san-francisco/l717c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in San Francisco&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room jacuzzi&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/los-angeles/5-star-hotels-in-los-angeles/l519c15" title="5 star hotels in los angeles" mce_href="http://www.raveable.com/ca/los-angeles/5-star-hotels-in-los-angeles/l519c15" style="color: rgb(0, 101, 226);"&gt;5 Star Hotels in Los Angeles&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable hotel reviews blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1729871" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/synchronizer/attachment/1729871.ashx" length="11651" type="image/jpeg" /><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SQL2005/default.aspx">SQL2005</category></item><item><title>Sync Services: What can SyncAnchor do for you, today?</title><link>http://blogs.msdn.com/synchronizer/archive/2007/02/18/sync-services-what-can-syncanchor-do-for-you-today.aspx</link><pubDate>Sun, 18 Feb 2007 10:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1702089</guid><dc:creator>Rafik</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/1702089.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=1702089</wfw:commentRss><description>&lt;p&gt;If you had time to browse the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=02989F70-49AA-43D7-81B8-A651120F8D65&amp;amp;displaylang=en" class="" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=02989F70-49AA-43D7-81B8-A651120F8D65&amp;amp;displaylang=en"&gt;documentation&lt;/a&gt; for &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=75FEF59F-1B5E-49BC-A21A-9EF4F34DE6FC&amp;amp;displaylang=en" class="" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=75FEF59F-1B5E-49BC-A21A-9EF4F34DE6FC&amp;amp;displaylang=en"&gt;Synchronization Services for ADO.NET&lt;/a&gt;, you might have seen a class called SyncAnchor. You don’t deal with it directly and none of the &lt;a href="http://blogs.msdn.com/synchronizer/archive/tags/Sync+Services+Demos/default.aspx" class="" mce_href="http://blogs.msdn.com/synchronizer/archive/tags/Sync+Services+Demos/default.aspx"&gt;demos&lt;/a&gt; in my blog interact with it directly except the server command called GetNewAnchor which returns a new timestamp value. However, as you build up your sync knowledge you will appreciate what this type can do for you. Hmm, have you noticed that too? Truly powerful types appear low profile from far! &lt;br&gt;&amp;nbsp;&lt;br&gt;The anchor in sync services is that marker that the client stores after every successful session in order to use it next time to tell the server where it left off in the last sync session. The server provider generates a new one for the new sync session. The changes between the old and the new anchors are enumerated and sent to the client. In simple scenarios, sync anchor will be something like timestamp, datetime or any monotonically increasing number that your server store maintains. However, it could carry much more than a number. You could overload the anchor to hold the date and time of when the sync took place; this is useful for detecting rouge client who did not sync for very long time that the server has lost track of&amp;nbsp;some old changes -&amp;nbsp;tombstones for example -&amp;nbsp;thus synchronizing with such client could result in data loss or non convergence.&amp;nbsp;In addition, you could also store a token for changes that the server could not pass on to the client in the current sync and would like to try aging in the next sync. The possibilities are endless.&lt;br&gt;&amp;nbsp;&lt;br&gt;One thing you need to be aware of is that the anchor value is serialized by the server provider prior to sending them to the client and desterilized before they are used at the server. Your application needs to follow this protocol to plug smoothly into the sync runtime and leverage the power of the sync anchor.&lt;/p&gt;&lt;p&gt;Tip: I had very interesting discussions in the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1"&gt;forum&lt;/a&gt;, make sure to check it out&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;. See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" mce_href="http://www.raveable.com/sc/myrtle-beach/top-10-hotels-in-myrtle-beach/l6180c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Myrtle Beach&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" title="best hotels in NYC" mce_href="http://www.raveable.com/ny/new-york-city/best-hotels-in-new-york-city/l5039c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in New York City&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" mce_href="http://www.raveable.com/wa/seattle/romantic-hotels-in-seattle/l7344c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-kitchen" title="hotels with kitchen or kitchenette" mce_href="http://www.raveable.com/hotels-with-kitchen" style="color: rgb(0, 101, 226);"&gt;Hotels with a kitchen or kitchenette&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-francisco/top-10-hotels-in-san-francisco/l717c3" title="top 10 hotels in san francisco" mce_href="http://www.raveable.com/ca/san-francisco/top-10-hotels-in-san-francisco/l717c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in San Francisco&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1702089" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Sync Services: Periodic Tombstone Cleanup</title><link>http://blogs.msdn.com/synchronizer/archive/2007/02/16/sync-services-tombstone-cleanup.aspx</link><pubDate>Fri, 16 Feb 2007 09:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1687184</guid><dc:creator>Rafik</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/1687184.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=1687184</wfw:commentRss><description>&lt;p&gt;One of the important topics in data synchronization is managing metadata used to track changes on the store. Just a quick reminder of the different kinds of metadata used in the &lt;a href="http://blogs.msdn.com/synchronizer/archive/tags/Sync+Services+Demos/default.aspx" class="" mce_href="http://blogs.msdn.com/synchronizer/archive/tags/Sync+Services+Demos/default.aspx"&gt;demos&lt;/a&gt; so far:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Adding inline columns to each table we plan to synchronize. Sync services runtime along with database triggers maintains the values for theses metadata columns.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Adding tombstone table to track deletes &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;As time goes by the deletes accumulate in the tombstone table and the size of that table grows. This is a problem and you should be concerned about it. Pretty much all sync systems have to deal with this problem in one way or another; sync services is no exception. So the question now is how can we manage the size of the tombstone tables?&lt;/p&gt;&lt;p&gt;A common approach for tombstone cleanup is setting up an “expiration policy”. Simply add a datetime column to the tombstone table and setup a job that runs every couple of hours (or at non peak times) to cleanup all records that are older than a couple of weeks for example. This is one of the knobs that you would expose to your system admins to tweak based on their environment workload.&lt;/p&gt;&lt;p&gt;The tombstone expiration policy has some side effects though. Consider this; what happened to a client synchronizes with the server after a period longer than that of the expiration policy? Basically, deletes for some of the rows are gone. There is only two options here, either fail the client sync request and ask the client to reinitialize its local database, or let it proceed without synchronizing the deletes. Most sync solutions fails the client sync request thus force it to reinitialize. This option guarantees conversion. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;. See examples:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" mce_href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" mce_href="http://www.raveable.com/wa/seattle/best-hotels-in-seattle/l7344c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;b&gt;&lt;a href="http://www.raveable.com/fl/miami/top-10-hotels-in-miami/l1644c3" mce_href="http://www.raveable.com/fl/miami/top-10-hotels-in-miami/l1644c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Miami&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px;"&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room hot tub&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/san-francisco/kid-friendly-hotels-in-san-francisco/l717c16" title="kid friendly hotels in san francisco" mce_href="http://www.raveable.com/ca/san-francisco/kid-friendly-hotels-in-san-francisco/l717c16" style="color: rgb(0, 101, 226);"&gt;Kid friendly hotels in San Francisco&lt;/a&gt;&lt;/b&gt;. Your feedback is welcome on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1687184" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item><item><title>Synchronization Services for ADO.NET Vs SQL Merge Replication</title><link>http://blogs.msdn.com/synchronizer/archive/2007/02/04/synchronization-services-for-ado-net-vs-sql-merge-replication.aspx</link><pubDate>Sun, 04 Feb 2007 08:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1595172</guid><dc:creator>Rafik</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/synchronizer/comments/1595172.aspx</comments><wfw:commentRss>http://blogs.msdn.com/synchronizer/commentrss.aspx?PostID=1595172</wfw:commentRss><description>&lt;p&gt;One of the common questions I get from developers once they get their hands on the new sync framework for ADO.NET is: How is it different from SQL Merge Replication? When should I use merge as oppose to sync services? Can sync services do filtering, ddl replication etc …? These are all interesting questions, so let’s talk about the scope of each product:&lt;/p&gt;&lt;p&gt;&lt;b&gt;Synchronization Services for ADO.NET&lt;/b&gt; is a development framework for developing occasionally connected systems that: &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Enables developers to build offline capabilities into their data applications easily and efficiently.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Provides an open model, allowing developers to sync data with different backend databases or any other relational data store&lt;/li&gt;&lt;li&gt;Uses SQLCE to provide small footprint, in-proc client database.&lt;/li&gt;&lt;li&gt;Supports unidirectional and bidirectional sync with conflict detection and resolution. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;b&gt;SQL Server Merge Replication&lt;/b&gt; is a powerful replication solution for synchronizing data between SQL Server Databases; it evolved overtime to cover very complex and demanding replication scenarios; today it provides the following features:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Join Filters&lt;/li&gt;&lt;li&gt;Partition Groups&lt;/li&gt;&lt;li&gt;Logical Records&lt;/li&gt;&lt;li&gt;Schema Changes Replication&lt;/li&gt;&lt;li&gt;Automatic data realignment&lt;/li&gt;&lt;li&gt;Column Tracking \ Conflicts detection&lt;/li&gt;&lt;li&gt;Backward Compatibility&lt;/li&gt;&lt;li&gt;Backup and Restore&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br&gt;Obviously, the scope of each product and the target audience is quite different. While developers use Merge Replication today, they don’t have a lot of control on how it works. Sync framework, on the other hand, puts developers on the driver seat, but takes away many of the high-end features to keep the framework simple and applicable to the most common scenarios. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Download&lt;/b&gt; the CTP: &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=75FEF59F-1B5E-49BC-A21A-9EF4F34DE6FC&amp;amp;displaylang=en" class="" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=75FEF59F-1B5E-49BC-A21A-9EF4F34DE6FC&amp;amp;displaylang=en"&gt;Microsoft Synchronization Services for ADO.NET CTP release&lt;br&gt;&lt;/a&gt;&lt;b&gt;Feedback&lt;/b&gt;: Visit &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1" class="" mce_href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&amp;amp;SiteID=1"&gt;Sync Services Forum&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="word-spacing: 0px; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: normal; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2;"&gt;Update: Just to let you know, I left Microsoft to start a new company,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/" class="" mce_href="http://www.raveable.com" style="color: rgb(0, 101, 226);"&gt;Raveable Hotel Reviews&lt;/a&gt;&lt;/b&gt;.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;See Examples:&amp;nbsp;&lt;b&gt;&lt;a href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" mce_href="http://www.raveable.com/sc/myrtle-beach/romantic-hotels-in-myrtle-beach/l6180c2" style="color: rgb(0, 101, 226);"&gt;Romantic Hotels in Myrtle Beach&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/wa/seattle/top-10-hotels-in-seattle/l7344c3" mce_href="http://www.raveable.com/wa/seattle/top-10-hotels-in-seattle/l7344c3" style="color: rgb(0, 101, 226);"&gt;Top 10 Hotels in Seattle&lt;/a&gt;&lt;/b&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.raveable.com/fl/miami/5-star-hotels-in-miami/l1644c15" mce_href="http://www.raveable.com/fl/miami/5-star-hotels-in-miami/l1644c15" style="color: rgb(0, 101, 226);"&gt;&lt;b&gt;5 Star Hotels in Miam&lt;/b&gt;i&lt;/a&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px; font-weight: bold;"&gt;&lt;a href="http://www.raveable.com/hotels-with-jacuzzi" title="hotels with jacuzzi" mce_href="http://www.raveable.com/hotels-with-jacuzzi" style="color: rgb(0, 101, 226);"&gt;Hotels with in-room jacuzzi&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/ca/anaheim/kid-friendly-hotels-in-anaheim/l751c16" title="family friendly hotels in anaheim" mce_href="http://www.raveable.com/ca/anaheim/kid-friendly-hotels-in-anaheim/l751c16" style="color: rgb(0, 101, 226);"&gt;Family Friendly hotels in Anaheim&lt;/a&gt;&lt;/b&gt;and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.raveable.com/fl/fort-lauderdale/best-hotels-in-fort-lauderdale/l1545c1" title="best hotels in fort lauderdale" mce_href="http://www.raveable.com/fl/fort-lauderdale/best-hotels-in-fort-lauderdale/l1545c1" style="color: rgb(0, 101, 226);"&gt;Best Hotels in Fort Lauderdale&lt;/a&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;. Your feedback is welcome on&lt;a href="http://twitter.com/raveable" mce_href="http://twitter.com/raveable" style="color: rgb(0, 101, 226);"&gt;twitter.com/raveable&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px;"&gt;,&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blog.raveable.com/" title="raveable blog" mce_href="http://blog.raveable.com" style="color: rgb(0, 101, 226);"&gt;raveable blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1595172" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/synchronizer/archive/tags/SyncServices/default.aspx">SyncServices</category></item></channel></rss>