473,808 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to detect a deadlock and how to clear it when it occours?

hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?

Jan 31 '07 #1
3 17375
"kavin" <ka************ *@gmail.comwrot e in message
news:11******** **************@ j27g2000cwj.goo glegroups.com.. .
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?
By default, deadlocks (-911 RC 2) are detected and resolved (by DB2
cancelling one of the applications) every 10 seconds. You can set up a
deadlock event monitor to monitor them. If the database was created in
version 8.2 or later then a deadlock event monitor was created by default.

An infinite lock wait can be detected and resolved by running the following
parm to change the db config:
db2 update db cfg using locktimeout 30 for db-name

This will resolve a lock wait after 30 seconds and then cancel the
transaction (-911 RC 68).
Feb 1 '07 #2
DB2 has an automatic process that checks for deadlocks. It "perks" up every
10 secs. by default.
If a deadlock is detected, one member will be rolled back and the other will
proceed. Unless you want a 7 day dissertation, do not ask how DB2 chooses.

If you are running DB2 V8 and up then when you create a db, by default an
event monitor called DB2 DETAILDEADLOCK with an auto start option is
created.
This means that if deadlocks are encountered and resolved, they have been
identified and detailed in the output files of the event monitor. On my
Windoze home box, they are in:
d:\instname\nod e0000\SQL0001\d b2event

Those files need to be formatted for intelligent reading and you use the
db2evmon tool to do so.

HTH' Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"kavin" <ka************ *@gmail.coma écrit dans le message de news:
11************* *********@j27g2 00...legr oups.com...
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?
Feb 1 '07 #3
On Feb 1, 1:19 am, "kavin" <kavinilammur.. .@gmail.comwrot e:
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?
I have found the db2pdcfg utility to be incredible useful when
troubleshooting deadlocks. It produces a dump of all the agents in the
database and what database objects they are busy with when a deadlock
is detected by db2. By mining this information you can solve the
concurrency problems in your application.
db2pd is also useful.

Feb 2 '07 #4

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

Similar topics

0
1748
by: steven | last post by:
In both mysql version 4.0.16 and 4.1.8 I'm running into deadlock behavior that I don't understand: can anyone explain why the following happens? Heres a basic table definition that exhibits the behavior and some data I inserted: create table deadlock_test ( id integer not null, primary key(id) ) type=innodb;
1
3043
by: New MSSQL DBA | last post by:
I have recently been assigned to take over several MSSQL environments and found some of the existing practice confusing. As most of my previous experiences are on Oracle and Unix platform so would like your inputs and comments. 1) TX log truncate: In the existing environment, there are scheduled jobs to truncate transaction log of each database in the server and shrink them back to a desired size, say 1G. These jobs are all scheduled...
2
8280
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...
0
1037
by: JP2006 | last post by:
I have a ASP page that is made up of several individual web controls. One of these controls is a button that when clicked will postback to the page with a querystring parameter. However this parameter does not seem to register when the page is posted (nor can I detect the postback event itself). I am presuming this is something to do with the fact that my page is made up of seperate controls. I really need a way to be able to detect on the...
0
11708
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
4
1734
tpgames
by: tpgames | last post by:
Here is the code for 1 question and answer, and the play again code. When I use a play again code, the answers do not erase. What code am I missing? Thanks! <tr><td class="line1" colspan="4"> <br> <tr><td class="question" colspan="4"> <!--QUESTION20--> <b> 20) Which picture shows Jessie <br> carrying a Living Stone? </b>
1
1054
by: nagar | last post by:
Is there a way to detect if my application has been launched as minimized or maximized (this before showing the main form). Thank you. Andrea
1
8833
by: Arif Mohammed | last post by:
Hi, iam using MySql 4.0.1 and jboss-4.0.4.GA Iam getting the following exception when there are more concurrent requests more than 50 in a second Caused by: org.xyz.MyClass: SQL Exception:Deadlock found when trying to get lock; Try restarting transaction, message from server: "Lock wait timeout exceeded; Try restarting transaction" at com.xyz.retrieveDetails(MySessionBean.java:679) at...
1
2031
by: DWiggin | last post by:
We are getting deadlock errors (sporadically) on a batch job we've created. This job runs against a SQL Server 2000 back-end. The first step of the batch job is to run a DDL script to drop and create 4 tables that are used in the job. The tables are only used during this job and are not accessed by any other process or application. The second step of the batch job is to make an OSQL call to run the stored procedures associated with...
3
289
by: john ciriello | last post by:
Hi, is there an easy way to detect when the mouse pointer enters a disabled button? For example I have a button I can see but it is greyed out. When the mouse moves over it I would like to be able to right click and have it respond with a context menu. Any ideas? Thanks in advance.
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10628
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
10373
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...
0
10113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9195
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
7651
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
5547
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.