473,475 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

deadlock related

Hi ,

I am trying to acquire a lock on a table A in exclusive mode, and this
statement gives an error indicating a deadlock or timeout
has been detected. The lock timeout value is set to 0 which I understand
is to wait for however long it takes to acquire a lock.

Also there are other processes that have acquired row level exclusive
locks on the table A when this error happened.Is DB2
throwing this error as a pre-emptive measure.

I was expecting that the lock table A in exclusive mode statement would
be a blocking call. Any thoughts?

Thanks,
Sumanth

Logs:
lock table Schema.A in exclusive mode ;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/NT] SQL0911N The current
transaction has been rolled back because of a deadlock or timeout. Reason
code "2". SQLSTATE=40001

Mar 24 '06 #1
2 8948
"Sumanth" <Su************@sas.com> wrote in message
news:e0**********@foggy.unx.sas.com...
Hi ,

I am trying to acquire a lock on a table A in exclusive mode, and this
statement gives an error indicating a deadlock or timeout
has been detected. The lock timeout value is set to 0 which I
understand is to wait for however long it takes to acquire a lock.

Also there are other processes that have acquired row level exclusive
locks on the table A when this error happened.Is DB2
throwing this error as a pre-emptive measure.

I was expecting that the lock table A in exclusive mode statement would
be a blocking call. Any thoughts?

Thanks,
Sumanth

Logs:
lock table Schema.A in exclusive mode ;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/NT] SQL0911N The current
transaction has been rolled back because of a deadlock or timeout. Reason
code "2". SQLSTATE=40001


Reason code 2 indicates that it is a deadlock, and not a locktimeout (which
is reason code 68). So the error is because DB2 has detected a deadlock (by
default, the deadlock detector fires every 10 seconds to see if any
deadlocks exist, and if so it will cancel one of the applications).

If you cannot figure out the problem, then I would suggest setting up an
event monitor for deadlocks. With V8.2 and requesting detail reports you can
see the actual SQL statements involved in the deadlock. See the Command
Reference.
Mar 25 '06 #2
Mark A wrote:
"Sumanth" <Su************@sas.com> wrote in message
news:e0**********@foggy.unx.sas.com...
Hi ,

I am trying to acquire a lock on a table A in exclusive mode, and this
statement gives an error indicating a deadlock or timeout
has been detected. The lock timeout value is set to 0 which I
understand is to wait for however long it takes to acquire a lock.

Also there are other processes that have acquired row level exclusive
locks on the table A when this error happened.Is DB2
throwing this error as a pre-emptive measure.

I was expecting that the lock table A in exclusive mode statement would
be a blocking call. Any thoughts?

Thanks,
Sumanth

Logs:
lock table Schema.A in exclusive mode ;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/NT] SQL0911N The current
transaction has been rolled back because of a deadlock or timeout. Reason
code "2". SQLSTATE=40001


Reason code 2 indicates that it is a deadlock, and not a locktimeout (which
is reason code 68). So the error is because DB2 has detected a deadlock (by
default, the deadlock detector fires every 10 seconds to see if any
deadlocks exist, and if so it will cancel one of the applications).

If you cannot figure out the problem, then I would suggest setting up an
event monitor for deadlocks. With V8.2 and requesting detail reports you can
see the actual SQL statements involved in the deadlock. See the Command
Reference


If I am not mistaken, in V8.x the deadlock event monitor is created and
activated by default, unless otherwise disabled or dropped. It should
already be there. Use the GUI in the Control Centre to view the information.

Bob
Mar 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andrew Mayo | last post by:
Here's a really weird one for any SQL Server gurus out there... We have observed (SQL Server 2000) scenarios where a stored procedure which (a) begins a transaction (b) inserts some rows into...
2
by: Jenny Zhang | last post by:
I am running OSDL-dbt1 - an e-commerce workload (http://www.osdl.org/lab_activities/kernel_testing/osdl_database_test_suite/osdl_dbt-1/) against PostgreSQL: 7.3.3. During the test, I saw a lot of...
3
by: Nigel Robbins | last post by:
Hi There, I'm getting a deadlock when I have two clients running the following statement. DELETE FROM intermediate.file_os_details WHERE file_uid = ? AND obj_uid There is a compound index on...
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
15
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
8
by: Joe Weinstein | last post by:
Hi. create table joe(c1 integer not null, c2 integer not null) Two sessions: Session 1: BEGIN TRAN insert into joe (c1,c2) values (1,2)
0
by: cwho.work | last post by:
Hi! We are using apache ibatis with our MySQL 5.0 database (using innodb tables), in our web application running on Tomcat 5. Recently we started getting a number of errors relating to...
1
by: rkeith27 | last post by:
Okay, here goes... deadlocks have been occurring since Dec 17, 2007 on database; however, no changes were made to the code or the database. The application had been in production for 1 1/2 years...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.