<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Replicating self-referencing tables and circular foreign keys with Microsoft Sync Framework</title>
	<atom:link href="http://www.8bit.rs/blog/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.8bit.rs/blog/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 18:20:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: bdrajer</title>
		<link>http://www.8bit.rs/blog/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/comment-page-1/#comment-877</link>
		<dc:creator>bdrajer</dc:creator>
		<pubDate>Wed, 24 Nov 2010 13:22:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bit.rs/blog/index.php/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/#comment-877</guid>
		<description>Hi Mickaël,

Sorry for the delay. It took some time but I managed to slap up an example source file. It&#039;s somewhat different from the code shown above (a bit more complicated), but hopefully it will help you get around. See the update at the end of the post.</description>
		<content:encoded><![CDATA[<p>Hi Mickaël,</p>
<p>Sorry for the delay. It took some time but I managed to slap up an example source file. It&#8217;s somewhat different from the code shown above (a bit more complicated), but hopefully it will help you get around. See the update at the end of the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mickaël</title>
		<link>http://www.8bit.rs/blog/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/comment-page-1/#comment-866</link>
		<dc:creator>Mickaël</dc:creator>
		<pubDate>Thu, 18 Nov 2010 15:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bit.rs/blog/index.php/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/#comment-866</guid>
		<description>Hi,

I&#039;m trying to create a poc of your idea. On the second adapter, you only have two commands ?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m trying to create a poc of your idea. On the second adapter, you only have two commands ?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bdrajer</title>
		<link>http://www.8bit.rs/blog/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/comment-page-1/#comment-865</link>
		<dc:creator>bdrajer</dc:creator>
		<pubDate>Thu, 18 Nov 2010 10:28:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bit.rs/blog/index.php/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/#comment-865</guid>
		<description>Hi,

I don&#039;t have a standalone example for this, it&#039;s an excerpt from a big implementation, sorry... But if you can tell me what exactly is the problem, I may be able to help.

Here&#039;s an idea that could be useful: the code I have shown above was written in the same manner as what is generated by the Local Database Cache designer (which is built into the Visual Studio). If you add a Local Database Cache item to a project, point it to a database and select a couple of tables from it, it will generate (in its *.Designer.cs file) code that is very similar to the one in my post. But, where the designer produces a single sync adapter for one table (and only for one-way replication), my solution uses two - one &quot;normal&quot; and one for the second pass replication. Look at the designer-generated InitializeSyncAdapters() method, it is responsible for creating adapters and adding them to the internal adapters collection. Modify this code so that it instantiates our &quot;normal&quot; adapter instead of the of the generated one, and add the second-pass one at the end. In this way, the normal adapter will replicate all fields except the circular-referencing ones, and the second pass adapter will come at the end and update what&#039;s missing. (Of course, if you modify generated code and use the designer, you&#039;ll lose your changes - so copy the code somewhere else, you may have to reconstruct the generated class a bit to be able do this).

Hope this makes any sense... It&#039;s not a trivial task because there may be a lot of code to be written, but the code itself is not too complicated (you could modify the generated code or write your own generator for it), so it&#039;s not too hard either.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I don&#8217;t have a standalone example for this, it&#8217;s an excerpt from a big implementation, sorry&#8230; But if you can tell me what exactly is the problem, I may be able to help.</p>
<p>Here&#8217;s an idea that could be useful: the code I have shown above was written in the same manner as what is generated by the Local Database Cache designer (which is built into the Visual Studio). If you add a Local Database Cache item to a project, point it to a database and select a couple of tables from it, it will generate (in its *.Designer.cs file) code that is very similar to the one in my post. But, where the designer produces a single sync adapter for one table (and only for one-way replication), my solution uses two &#8211; one &#8220;normal&#8221; and one for the second pass replication. Look at the designer-generated InitializeSyncAdapters() method, it is responsible for creating adapters and adding them to the internal adapters collection. Modify this code so that it instantiates our &#8220;normal&#8221; adapter instead of the of the generated one, and add the second-pass one at the end. In this way, the normal adapter will replicate all fields except the circular-referencing ones, and the second pass adapter will come at the end and update what&#8217;s missing. (Of course, if you modify generated code and use the designer, you&#8217;ll lose your changes &#8211; so copy the code somewhere else, you may have to reconstruct the generated class a bit to be able do this).</p>
<p>Hope this makes any sense&#8230; It&#8217;s not a trivial task because there may be a lot of code to be written, but the code itself is not too complicated (you could modify the generated code or write your own generator for it), so it&#8217;s not too hard either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mickaël</title>
		<link>http://www.8bit.rs/blog/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/comment-page-1/#comment-864</link>
		<dc:creator>Mickaël</dc:creator>
		<pubDate>Thu, 18 Nov 2010 09:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.8bit.rs/blog/index.php/2009/12/replicating-self-referencing-tables-and-circular-foreign-keys-with-microsoft-sync-framework/#comment-864</guid>
		<description>I have the same problem but I don&#039;t understand how to integrate your solution in my development. Can you share a sample please ?

Thanks</description>
		<content:encoded><![CDATA[<p>I have the same problem but I don&#8217;t understand how to integrate your solution in my development. Can you share a sample please ?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

