MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Table Lock -913

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
nagapa
Beginner


Joined: 16 Sep 2004
Posts: 11
Topics: 4

PostPosted: Thu Nov 04, 2004 11:51 am    Post subject: Table Lock -913 Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Nov 04, 2004 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
nagapa
Beginner


Joined: 16 Sep 2004
Posts: 11
Topics: 4

PostPosted: Fri Nov 05, 2004 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Nov 08, 2004 10:42 am    Post subject: Reply with quote

nagapa,
LOCKSIZE is defined at the tablespace level and not at a table level.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Mon Nov 08, 2004 4:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
suggala_r
Beginner


Joined: 07 Nov 2004
Posts: 12
Topics: 2

PostPosted: Tue Nov 09, 2004 12:48 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group