﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Timothy  Claason  / Is Your Database Application DeadLock and Timeout Resistent? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 21:44:15 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>WHERE ius.database_id = DB_ID() AND DB_NAME(ius.database_id)=@YourDatabaseNameThe first condition is sufficient right?  ius.database_id = DB_ID() should uniquely identify the correct database without the need for checking the db name as well.Or am I missing something?Thanks!</description><pubDate>Thu, 18 Mar 2010 08:16:46 GMT</pubDate><dc:creator>Karl Kieninger</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>Hi Tim,I am pretty sure that this statement is not accomplishing what you intended.exec('USE ' + @YourDatabaseName)When Exec is executed the database context is changed, but only for the statement(s) in the parenthsis.  When Exex completes the database context returns to its previous setting.You can see that behavior with the following test script.[code="sql"]Use AdventureWorksDeclare @myDatabase varChar(255)Set @myDatabase = 'Northwind'Exec ('Use ' + @myDatabase + '; Select db_Name(); Select [name] from sys.objects where type = ''U'' ')Select db_Name()Select [name] from sys.objects where type = 'U'[/code]You will see that the database context returns to AdventureWorks after the conclusion of the Exec script.I am still looking for a reasonable methog to dynamically change the database context so if you find one please post it :)</description><pubDate>Tue, 16 Mar 2010 10:48:27 GMT</pubDate><dc:creator>Ray Herring</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>[quote][b]GDI Lord (3/10/2010)[/b][hr]Perhaps you should note in your article that the first script that you posted, the one that shows "TimesAccessed", only shows the data since the last restart of the SQL Server instance.[/quote]Indeed.  Good point GDI Lord.</description><pubDate>Thu, 11 Mar 2010 07:13:13 GMT</pubDate><dc:creator>timclaason</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>Perhaps you should note in your article that the first script that you posted, the one that shows "TimesAccessed", only shows the data since the last restart of the SQL Server instance.</description><pubDate>Wed, 10 Mar 2010 23:36:54 GMT</pubDate><dc:creator>AndrewJacksonZA</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>Thanks Tim.  I will add this to my tool-set.</description><pubDate>Wed, 10 Mar 2010 12:49:05 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>[quote][b]timothyawiseman (3/10/2010)[/b][hr]Of course, I cannot overemphasize the fact that developers should be careful and thoughtful in using it since it risks dirty reads.[/quote]Agreed.  It's easy for the scope of an article like this to expand exponentially.  Each of the ways that I mentioned to deal with resource contention, etc, could have been their own article, and it would be easy to spend hours (or at least lots of minutes) talking about each one.Every one of the things I mentioned carries some level of risk (taking database interaction off the UI thread, playing with isolation levels, query hints, etc), but then again, we live in a pretty risky world :-)</description><pubDate>Wed, 10 Mar 2010 12:25:14 GMT</pubDate><dc:creator>timclaason</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>A very interesting and thought provoking article.  Thank you!On actually making your application more resistant to locking, the [i]careful[/i] use of the "with (nolock)" query hint can improve performance on a server with a lot of locking tremendously.Of course, I cannot overemphasize the fact that developers should be careful and thoughtful in using it since it risks dirty reads.  But there are times when a dirty read is acceptable, such as when you can known with great confidence that the records you are selecting are not being modified at that moment or when all you really care about is rough approximations of aggregate values.  In those cases, it can be tremendously helpful.</description><pubDate>Wed, 10 Mar 2010 12:02:05 GMT</pubDate><dc:creator>timothyawiseman</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>nice article can you also give us the solutions to make it resistent</description><pubDate>Wed, 10 Mar 2010 03:13:56 GMT</pubDate><dc:creator>Abhijit More</dc:creator></item><item><title>RE: Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>Any cheap and cheerful mechanisms for testing this issue in a non-production environment are most welcome. Brute force will reveal issues that really need sorting.</description><pubDate>Wed, 10 Mar 2010 02:38:05 GMT</pubDate><dc:creator>Craig@Work</dc:creator></item><item><title>Is Your Database Application DeadLock and Timeout Resistent?</title><link>http://www.sqlservercentral.com/Forums/Topic879936-2631-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Database+load/69378/"&gt;Is Your Database Application DeadLock and Timeout Resistent?&lt;/A&gt;[/B]</description><pubDate>Tue, 09 Mar 2010 22:45:06 GMT</pubDate><dc:creator>timclaason</dc:creator></item></channel></rss>