Solved

concurrent access deadlocks

Posted on 2006-06-21
4
1,616 Views
Last Modified: 2011-09-20
I am using Work objects (asynch beans) running inside websphere app server 6.0. and hibernate as O/R layer.

There are about 80 Work objects, querying and updating tables in DB2 simultaneously.
I have set the lock percentage parameter to 100% for this database and I am sure there is no concurrent access to the same records by more then one thread because each Work object is assigned a different group of records.

Still I get deadlocks after a the application is running for a while (minutes).

Will appreciate any ideas.

0
Comment
Question by:aditi1
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ocgstyles earned 250 total points
ID: 16953206
Hi aditi1,

Deadlocks are hard to track in real time, since by the time you try to find out what locks are conflicting, one of the applications' transactions has rolled back.  You can track the number of deadlocks encountered using a snapshot, but to get the detail on the locks, you to use an event monitor.  This will tell you what locks existed at the time of the deadlock as well as the locks granularity (row or table)

What I imagine is happening is...
If one if your applications is requesting row locks, and you exceed the percentage of the lock list you're allowed, a lock escalation will occur and DB2 will try to convert your row locks into a table lock.  If lock escalation is attempted while other row locks exist, that application will sit in lock wait.  Eventually everything will come to a halt and something is going to roll back.  

You can view this link to set up an event monitor to see what's causing the deadlocks:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000915.htm

Usually commiting more often can clear this up...

Good luck,

- Keith
0
 

Author Comment

by:aditi1
ID: 16953789
Thanks Keith, I am working at this direction (trying to monitor and analyze the deadlocks), but what i'm not sure of is how can the application exceed 100% maxlocks value? is there additional parameters that limit the ammount of locks that you think I should check?

Regards,
Adi
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 16954422
Hi Adi,

I just read a bit more on the MAXLOCKS parameter, because I wasn't sure what would actually happen when MAXLOCKS is set that high.  The article suggests that this is a find-a-happy-medium parameter.  Setting too this too low will cause frequent lock escalations among applications only holding a few locks, and setting it too high causes the same effect with the last n percent of applications trying to request only a few locks, since there's not enough room to hold all the row locks they need.  

Here's the help file on that parameter:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000268.htm

Did monitoring show conclusive results?

- Keith
0
 

Author Comment

by:aditi1
ID: 16957718
Hi Keith,

I'm not sure I understand the behaviour you described - I will look at the article see if it makes any sense.
I believe using maxlock of 100% isnt a normal configuration, I just set it to this extreme to see if I still get the same problems.
Anyway we are still working on the monitoring and I will have a pro DBA with me for that so I hope we will figure this out.

Thanks!

-Adi
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now