Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: When the program abends if we Fetch the 'locked' table
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: 686
Location: Earth

PostPosted: Wed Apr 04, 2007 7:00 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us