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
 

 

Question on: Partition level lock with commit

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Mon Feb 28, 2011 1:52 pm    Post subject: Question on: Partition level lock with commit
Reply with quote

Hi,

I have locked the partition in exclusive mode with the partition number passed as a PARM from the job. The program will perform a commit for every 1000.
Now my question is "Will the LOCK be release if a commit is issued before processing all the records?"

Ex:- Input file has 1500 record belongs to 7th partition in a DB2 table. 7th partition will be locked in Exclusive mode (below is the SQL code) and commit is issued after processing 1000 records.

Will the lock be released after commit is issued or lock still exist until the job ends?
Code:
EXEC SQL                                     
    LOCK TABLE TABLENAME [color=blue]PART 7[/color] IN EXCLUSIVE MODE
END-EXEC                                     

Could some one clarify me ?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Feb 28, 2011 2:50 pm    Post subject:
Reply with quote

I did not know the answer until i looked at the SQL Reference manual
and found the answer in the NOTES: section of the LOCK TABLE description.
Back to top
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Mon Feb 28, 2011 3:10 pm    Post subject:
Reply with quote

Hi Dick,

"Thanks a lot" for looking into the manuals for me...

I found the answer in the same mannual as you suggested.

My bind CARD is coded as "RELEASE(DEALLOCATE)".
Hence the lock will be released only at the end of the job.

Thanks again for your help!!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Feb 28, 2011 4:11 pm    Post subject:
Reply with quote

task not job,
I realize that you may be executing in a batch environment,
but even then, it would be end of step, not end of job.
online evironment, would be end of task.

I know that the manual said, end of application,
but application means end-of-step if it is batch or end-of-task if it is online.

but, then again, if you have explicitly attachted to db2 (e.g. RRSAF), your 'application' could detach from db2, and continue running, be the detach would be the point of lock release.


but otherwise, excellent, and apologize for my abruptness.
Back to top
View user's profile Send private message
Bhargav_1058

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Mon Feb 28, 2011 4:19 pm    Post subject:
Reply with quote

Dick,

This is a batch environment, Locking in the exclusive mode and updating the table is the last step in my job. So, I have mentioned as end of job.

I am sorry for the confusions.

Thanks for correcting me..!!
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 Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm


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