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

When the program abends if we Fetch the 'locked' table


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

New User


Joined: 16 Mar 2007
Posts: 9
Location: pune

PostPosted: Wed Apr 04, 2007 4:27 pm
Reply with quote

Hi,

When we lock table & run the program which have cursor on that table.
At what time program gives error? i.e. at time of opening cursor or at time of fetching.

thank you.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Apr 04, 2007 7:00 pm
Reply with quote

Quote:
Theory! icon_biggrin.gif
It depends on 'locktimeout' database configuration parameter. If this is set to -1 then second program (Cursor in this case ) will wait forever for the first program to release lock.
If it is set to a finite value then and if the desired lock is not acquired before the time interval specified elapses, the waiting application receives an error and the transaction requesting thelock is rolled back.
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Thu Apr 05, 2007 8:00 pm
Reply with quote

The question was: When will the timeout/deadlock occur..?

OPEN or FETCH ..?

It would depend on how the cursor is defined and when you are supplying the values to the host variables. If you have supplied the values to the host variables of the WHERE clause before OPEN, then you should get timeout at OPEN statement.

I assume you have locked the table in EXCLUSIVE MODE.
If you have locked in SHARE mode and if you query is read only with UR isolation level, you will never get -911. In fact this is a huge concept. Manuals have a good documentation on this.
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 Using API Gateway from CICS program CICS 0
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 Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top