View previous topic :: View next topic |
Author |
Message |
nagapa Beginner
Joined: 16 Sep 2004 Posts: 11 Topics: 4
|
Posted: Thu Nov 04, 2004 11:51 am Post subject: Table Lock -913 |
|
|
Hi,
I have a program that selects a record from a table and updates it. This table is a counter table, which holds all counter values. My programs picks a specific record from this table, uses the counter value and updates it with the new value. During this process the table is locked. When another program tried to access this table for a diff counter value, its abends with deadlock error -913.
Can anyone suggest a solution to get rid of this -913 abend in this logic.
Is there a way to do row level locking instead of table lock.
Regards
Nagappan |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Nov 04, 2004 12:28 pm Post subject: |
|
|
nagapa,
Try the following actions -
- Define the tablespace of the table with LOCKSIZE - ROW.
- Use an isolation level of CS in your program which retrieves the counter value.
See if that solves your problem.
Regards,
Manas |
|
Back to top |
|
|
nagapa Beginner
Joined: 16 Sep 2004 Posts: 11 Topics: 4
|
Posted: Fri Nov 05, 2004 8:55 am Post subject: |
|
|
Thanks Manas,
As developers we usually dont create table, but I have admin rights. Can I redefine this existing table for LOCKSIZE - ROW, or I have go for a new table and copy across the data from old to new.
Regards
Nagappan |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Mon Nov 08, 2004 10:42 am Post subject: |
|
|
nagapa,
LOCKSIZE is defined at the tablespace level and not at a table level.
Regards,
Manas |
|
Back to top |
|
|
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Mon Nov 08, 2004 4:36 pm Post subject: |
|
|
Nagapa,
Ther are so many different variables that can impact. For example what is the size of the table you are updating - if its a very small table, DB2 takes a table lock else it will go for a page lock. How often do you commit, how important is the select in the second program - can it use WITH UR ? Is your process Batch or Online ? Most often its a design solution. Unless locks are held for too long it should be simple to handle programatically. Thanks |
|
Back to top |
|
|
suggala_r Beginner
Joined: 07 Nov 2004 Posts: 12 Topics: 2
|
Posted: Tue Nov 09, 2004 12:48 am Post subject: |
|
|
Nagapa,
As sureshkumar mentioned..You may need to consider all the factors what he mentioned..Added to that if it is online program..Handle -913
condition and retry the same paragraph 5-10 times..you should be able to
overcome..unless there is huge volume (Hits) on the same table..
Raghu _________________ Raghu |
|
Back to top |
|
|
|
|