IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Exclusive table lock for a job to avoid -911


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Jun 30, 2010 6:39 pm
Reply with quote

Hi,

One of my job often fails with -911 contention with the same another job belonging to a different subsystem. I want to do a permanent fix by giving my job an exclusive lock of the table which both of it uses. Please can anybody advice me on how to modify my 'update table' statement in the program so that it gets an exclusive lock and avoids this contention?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Wed Jun 30, 2010 6:44 pm
Reply with quote

So what will happen to the other job when it try to access the table -911 right ? So probably the user in the other subsystem will also be thinking in the same line. Why not schedule the jobs to run at different times ?
You need to lock the table exclusively at the start of your program or before you apply any updates or deletes.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 30, 2010 6:47 pm
Reply with quote

Quote:
so that it gets an exclusive lock and avoids this contention?


and locks-out the other job?

as often is the case, the design is at fault.

exclusive locks should not be used by those who want to implement them without knowing how.

-911's come with a reason code. so start there.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 30, 2010 6:54 pm
Reply with quote

use IBM's error LookAt Site which will point you to the reference material,
which will tell you where to find the reason code explanations.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Jul 01, 2010 3:33 pm
Reply with quote

LOCK TABLE statement ?
But of course it is still bad practice .
Contention have to be solved at a scheduling level and/or commit frequency.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 01, 2010 7:51 pm
Reply with quote

Hello,

Suggest you consider changing the design of the conflicting processes. . .

The systems i support do not permit table locking - it is rejected when the process is in the review/promotion process. Why should we go back to single-user mode just because some processes are poorly designed icon_neutral.gif

A simple "do nothing" solution might be to properly schedule these so they do not run concurrently. . .
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Jul 02, 2010 10:30 am
Reply with quote

Hi,
Thanks for all your help...I am currently working with the other subsystem's scheduler to sort this out...and He's suggesting that we set a dependency to our job on their job as ours is not so critical one...lets see what comes out of it...Thanks a lot again for your help.

Regards,
Souren
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 02, 2010 7:43 pm
Reply with quote

You're welcome - good luck icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Lock Escalation DB2 3
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top