473,769 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ 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 8967
"Sumanth" <Su************ @sas.com> wrote in message
news:e0******** **@foggy.unx.sa s.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.sa s.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
9227
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 a table (c) re-queries another table using a subquery which references the inserted table (correlated or not)
2
8278
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 messages in the database log file: NOTICE: _sc_id=0, _add_flag=0, _itemcount=0, _i_id=597, _pp_i_id=159, c_id=32760 ERROR: deadlock detected WARNING: Error occurred while executing PL/pgSQL function shopping_cart WARNING: line 311 at SQL...
3
7627
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 file_uid / obj_uid. The isolation level is UR and I have set DB2_RR_TO_RS=YES. Any thoughts why I'm getting the deadlock ?
1
4242
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. From the log it looks like the problem happens when 2 threads insert 1 record each in the same table and then try to aquire a NS (Next Key Share) lock on the record inserterd by the other thread. Thanks Rohit
15
10002
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) 3-4 times and give up if after that it's still in deadlock. I'm very sure that many experienced people out there already deal with this issue somehow. Is there an alternative to it? Thanks for your comments and suggestions.
1
3689
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 "access_log", the referential integrity triggers generate these queries: SELECT 1 FROM ONLY "public"."application_type" x
8
3356
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
11702
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 java.sql.SQLException: Deadlock found when trying to get lock; Try restarting transaction message from server: "Lock wait timeout exceeded; try restarting transaction"; We get such errors generally on inserts or updates while applying a
1
1108
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 before the deadlocks began occurring. On Dec. 17, 2007 two KB updates from Microsoft were installed but neither was SQL related. One for Daylight Savings and the other for a Macrovision driver exploit. Also, our ISP was changed and a new database that...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.