Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

concurrent access deadlocks

Posted on 2006-06-21
4
Medium Priority
?
1,633 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ocgstyles earned 750 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

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

715 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