Editorials

SQL Server App Locks

SQL Server App Locks
I like to do three different kinds of reading. For solving problems I like to do web searches to locate solutions or syntax. A second kind of reading I like to do is scanning where I am looking for topics of which I am not aware (which gets bigger every day). The third type of reading is detailed, intentional, trying to learn the specifics of a single topic in detail.

I find scanning can be done on the internet or by looking through books without an intention to fully understand. In the process of scanning this week I came across a kind of lock that was introduced in SQL Server 2005 called an Application Lock. This lock type is completely foreign to me.

Application locks work completely different from all other locks in SQL Server. They are supported in all versions of SQL Server since 2005. They do not lock any objects or tables. They are completely user defined. They work as a sort of semaphore and can be used inside transactions.

One example I read about an application lock was if you wanted only one thread to be able to exercise a specific stored procedure you could require an application lock be granted first. This assures that only one thread may execute the SP.

There is a lot to learn about application locks, how they work, and how they interact with transactions and consumers. Microsoft has a pretty good explanation at http://msdn.microsoft.com/en-us/library/ms189823.aspx.

Well, maybe this is something for you to put into your scanning bucket to learn more details at a later time. Why not share your scanning tips…things to review. Send me your ideas to btaylor@sswug.org.

Cheers,

Ben

SSWUGtv
Stephen Wynkoop and Nob Hill Software discuss new tools for managing the comparison, migration and code testing when combined with database moves and updates.
Watch the Show

$$SWYNK$$

Featured Article(s)
Best Practices for SSRS development
In this article I will try to put together the best practices that a developer should follow to get the optimum performance from their reporting services server. These guidelines cover both T-SQL guidelines as well as SQL Server Reporting Services best practices.

Featured White Paper(s)
All-At-Once Operations
Written by Itzik Ben-Gan with SolidQ

SQL supports a concept called all-at-onc… (read more)

Featured Script
GetSpTrigValues
Get trigger values for the specified database… (read more)