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
 

 

How to design an app which is acquired by online & batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 237

PostPosted: Tue Aug 31, 2010 3:13 pm    Post subject: How to design an app which is acquired by online & batch
Reply with quote

This was a question asked in a interview,

Interviewer:You have to design for an application where the application is accessed by online and batch program simultaneously. Assume your online application needs to update 5 rows in Table-A simultaneously your batch program needs to update 5 rows in Table-A. how you will design this application?

I said CS(Cursor Stability) will be used to maintain the concurrency.

Interviewer: If both application is trying to access the same resource at same time,how the application should be designed? Even using CS level the lock will be held in page level,after anyone of the application release the lock or move from the current page the other gets the opportunity to work on it. How this application should be designed??

Please let me know your suggestions.

Thanks,
Murali.
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Tue Aug 31, 2010 8:57 pm    Post subject:
Reply with quote

Hello,

Quote:
Even using CS level the lock will be held in page level,
This is a holdover from long ago. . . Good database systems support row level locking (DB2 does now also) and have for decades. . .

Many places keep page level locking because they don't have the experience or the confidence to install other than the "way it has always been". They also tend to use the old/original subsystem id's . . .

And they have lots of "opportunities" that should not be. . . icon_rolleyes.gif
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 237

PostPosted: Fri Sep 03, 2010 1:50 pm    Post subject:
Reply with quote

Where we have to specify the row-level lock? in Bind card?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Sep 03, 2010 7:17 pm    Post subject:
Reply with quote

Hello,

On the CREATE TABLESPACE statement is where the systems i support do this.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 237

PostPosted: Fri Sep 03, 2010 7:56 pm    Post subject:
Reply with quote

Interesting. If the lock mechanism is fixed then, how 'lock escalation' concept will be implemented? For example, if my application is switched from 'update' to 'browse' in such case tablespace needs to be changed? Do application dynamically won't change the lock level with the help of 'lock escalation'? Please let me know,whether 'lock escalation' is applicable.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Sep 03, 2010 11:29 pm    Post subject:
Reply with quote

Hello,

Suggest you spend some time with your dba and in the many discussions available in the IBM material as well as other papers that have been published. Some of the very basic concepts of multi-user access/update are not yet clear to you.

How do you "switch an application from update to browse"?

How did lock escalation become an item of concern? On properly implemented systems this rarely or never occurs. . .
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 237

PostPosted: Mon Sep 13, 2010 4:13 pm    Post subject:
Reply with quote

Dick,

It's not lock escalation,apologies. It's 'lock promotion'.

From ibm site

Quote:

Lock promotion
Lock promotion is the action of exchanging one lock on a resource for a more restrictive lock on the same resource, held by the same application process.

Example
An application reads data, which requires an IS lock on a table space. Based on further calculation, the application updates the same data, which requires an IX lock on the table space. The application is said to promote the table space lock from mode IS to mode IX.


How to acheive the above example if we define IS in tablespace? If DB2 itself does the job of lock promotion or it can be done manually?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Sep 13, 2010 7:53 pm    Post subject:
Reply with quote

Lock promotion is a change on restrictness on the same granularity :
ex.: From Intend Share to Intend Exclusive

Lock Escalation is a change of granularity on the same restrictness :
ex.: From page lock to Tablespace lock
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts Batch job tuning sgandhla Testing & Performance analysis 5 Fri Mar 24, 2017 9:41 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm


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