Hi,
I am facing dead lock issues in my production application. But same not
getting in my dev enviornment. Can you pls guide me like how to product a
dead lock scenario in my dev env.
thanks in advance.
BhaskarSure.
1. Open two Query Analyzer windows - Pubs sample database
2. In the first type BEGIN TRAN then an UPDATE to the authors table
3. In the second type BEGIN TRAN then an update to the titles table
4. From the second window now type SELECT * FROM authors
5. From the first window now type SELECT * FROM titles
You now have a deadlock. In this case SQL Server will chose one of the
connections as a deadlock victim. It's transaction will be rolled back and
the winners transction will commit.
6. Close both windows and do not commit any uncommitted transactions when
prompted.
HTH
Jerry
"Bhaskar" <Bhaskar@.discussions.microsoft.com> wrote in message
news:ED085BB9-6CE7-4111-B61B-832B494312D3@.microsoft.com...
> Hi,
> I am facing dead lock issues in my production application. But same not
> getting in my dev enviornment. Can you pls guide me like how to product a
> dead lock scenario in my dev env.
> thanks in advance.
> Bhaskar|||my intension is to create a dead lock sceanrio in the dev enviorment.
"Bhaskar" wrote:
> Hi,
> I am facing dead lock issues in my production application. But same not
> getting in my dev enviornment. Can you pls guide me like how to product a
> dead lock scenario in my dev env.
> thanks in advance.
> Bhaskar|||Ok...what I wrote will cause a deadlock to occur. I think you want to
re-create the same deadlock scenario in your dev env that you are now
getting in your prod env. That I can't do.
"Bhaskar" <Bhaskar@.discussions.microsoft.com> wrote in message
news:9A950577-D037-44A2-9107-770E557285DF@.microsoft.com...
> my intension is to create a dead lock sceanrio in the dev enviorment.
>
> "Bhaskar" wrote:
>|||Example:
Two diff connections. Try executing the batch iin conn 1 and quickly switch
to conn 2 and execute the batch.
-- conn 1
use northwind
begin transaction
update dbo.orders
set orderdate = getdate()
waitfor delay '00:00:25'
select * from dbo.[order details]
rollback transaction
-- conn 2
use northwind
begin transaction
update dbo.[order details]
set unitprice = 1
select * from dbo.orders
rollback transaction
go
As you can notice, they are accessing the resources in diff order.
AMB
"Bhaskar" wrote:
> Hi,
> I am facing dead lock issues in my production application. But same not
> getting in my dev enviornment. Can you pls guide me like how to product a
> dead lock scenario in my dev env.
> thanks in advance.
> Bhaskar|||Here are a couple of articles on tracing deadlocks:
http://www.sqlservercentral.com/col...ngdeadlocks.asp
http://support.microsoft.com/defaul...kb;en-us;832524
You can control how select queries acquire shared locks by specifying "set
transaction isolation level read uncommitted" or the "nolock" hint. This can
be especially useful if you have an application where multiple users are
performing fairly long queries against the same range of records:
http://msdn.microsoft.com/library/d... />
t_74bw.asp
http://msdn.microsoft.com/library/d... />
a_1hf7.asp
"Bhaskar" <Bhaskar@.discussions.microsoft.com> wrote in message
news:ED085BB9-6CE7-4111-B61B-832B494312D3@.microsoft.com...
> Hi,
> I am facing dead lock issues in my production application. But same not
> getting in my dev enviornment. Can you pls guide me like how to product a
> dead lock scenario in my dev env.
> thanks in advance.
> Bhaskar
Monday, March 26, 2012
product deadlock scenario
Labels:
application,
database,
dead,
deadlock,
enviornment,
facing,
guide,
lock,
microsoft,
mysql,
notgetting,
oracle,
pls,
product,
production,
scenario,
server,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment