<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - SQL Transaction Blocking On Foreign Key</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - SQL Transaction Blocking On Foreign Key</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Tue, 21 May 2013 07:03:23 GMT</pubDate>
	<lastBuildDate>Tue, 21 May 2013 07:03:23 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>4</c9:totalResults>
	<c9:pageCount>-4</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - SQL Transaction Blocking On Foreign Key</title>
		<description><![CDATA[<p>I'll try to keep this short.&nbsp; I have about 4 inserts I'm doing.<br /><br />The first insert is into a users table in a users database.<br /><br />The second insert is into a customers table in a billing database, that returns a customer id.<br /><br />The next 3 inserts are into other tables that have customerid as a foreign key.<br /><br />The odd thing is the first two are fine.&nbsp; Which are an addresses table insert and a credit card table insert.&nbsp; I pass in the customerid and it inserts fine.<br /><br />However, the one I'm having trouble with is a table called product subscriptions.<br /><br />These are all simple inserts.&nbsp; The product subscriptions doesn't have anymore relationships than the others, and the relationships it does have doesn't have any relationships to the customers or other tables.&nbsp; It only has a relationship to products, etc.<br /><br />Now, to backup, all of these are controlled by a sqltransaction ado.net object.<br /><br />When first debugging, I commented out hte product subscriptoins insert, and it worked fine and didn't hang.<br /><br />I also tried moving it up before the other two inserts, but then it hung.<br /><br />Also, what is odd is I did a select on all tables with no locking and the product subscriptions insert is happening, the data is there.<br /><br />To get it to work, I modified the relationship to NOT ENFORCE RI on inserts or updates.<br /><br />So, it's now working.&nbsp; However, it doesn't make any sense.&nbsp; The ONLY difference I can see between the product subscriptions insert and others, is that I pass in a CODE, that I then do a select on the product tables for the product id,&nbsp;the other two I just pass
 in directly the ID.<br /><br />I know it's hard to debug this without anyone seeing the actual code.&nbsp; I thought I'd post this to see if anyone ran across a similar problem.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/261920#261920</link>
		<pubDate>Fri, 28 Mar 2008 19:18:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/261920#261920</guid>
		<dc:creator>MetaGunny</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/MetaGunny/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - SQL Transaction Blocking On Foreign Key</title>
		<description><![CDATA[<p>Also, I know for a fact it's blocking on the Customers table and the resource type is a KEY.</p>
<p>I ran one of those sql locking stored procedures.&nbsp; It shows a WAIT on the customers table, the key resource type.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/0c185c50165c47cd8e709dfa00c2d3a8#0c185c50165c47cd8e709dfa00c2d3a8</link>
		<pubDate>Fri, 28 Mar 2008 19:26:06 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/0c185c50165c47cd8e709dfa00c2d3a8#0c185c50165c47cd8e709dfa00c2d3a8</guid>
		<dc:creator>MetaGunny</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/MetaGunny/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - SQL Transaction Blocking On Foreign Key</title>
		<description><![CDATA[<p>I take it you are understanding why the block is occurring, and you are asking for a technical way to avoid the block?<br /><br />Just to be clear before I throw anything in here..</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/b0ee4218b50b4f968ff19dfa00c2d41c#b0ee4218b50b4f968ff19dfa00c2d41c</link>
		<pubDate>Sat, 29 Mar 2008 22:02:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/b0ee4218b50b4f968ff19dfa00c2d41c#b0ee4218b50b4f968ff19dfa00c2d41c</guid>
		<dc:creator>stevo_</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/stevo_/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - SQL Transaction Blocking On Foreign Key</title>
		<description><![CDATA[<p>Stevo,</p>
<p>Well, I guess I'm looking for the proper solution.</p>
<p>For a number of reasons, I don't want to fix this by modifiying the relationship.</p>
<p>I'm looking for another answer or solution or maybe there is something that I'm missing.&nbsp; It doesn't make sense that two other relationships don't block, but this one does.</p>
<p>Thanks</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/7c3d508118904352985d9dfa00c2d495#7c3d508118904352985d9dfa00c2d495</link>
		<pubDate>Tue, 01 Apr 2008 20:00:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/261920-SQL-Transaction-Blocking-On-Foreign-Key/7c3d508118904352985d9dfa00c2d495#7c3d508118904352985d9dfa00c2d495</guid>
		<dc:creator>MetaGunny</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/MetaGunny/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>