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 take the LOCK on particular Transaction

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Wed Aug 17, 2011 5:30 pm    Post subject: How to take the LOCK on particular Transaction
Reply with quote

Hi All,
I am trying to avoid two simultaneously invoking of the same transaction(ABCD). User1 chooses the option 1 from CICS screen to invoke the tran 'ABCD'. Option1 invokes the program PRGM1.I used 'ENQ' command in my program PRGM1 which start the Tran ‘ABCD’. Tran 'ABCD' ideally invokes the program PRGM2(it is mapped with tran 'ABCD'). The LOCK which is taken by the ENQ command is getting released whenever program PRGM2 throws any map or calls any program. At this time, user2 is able to invoke the same Tran 'ABCD'.

I tried using INQUIRE TASK LIST command in PRGM1 to check if Tran ‘ABCD’ is already running. so that i can throw some error message from PRGM1 to the screen.This command is not retrieving the Tran 'ABCD' in its list.

FYI. PGRM2 is CICS program and designed using Pseudo conversation.

Could anybody please help me to take the LOCK on Tran 'ABCD' until the program PRGM2 (associated with the Tran 'ABCD') completes its work?

You can suggest me alternative way also to make sure that PRGM2 is executed by one user at a time until it completes its work.

Regards,
Sukumar
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 17, 2011 6:01 pm    Post subject:
Reply with quote

1. Talk to your site support group to find out what, if anything, your CICS system programmer recommends.

2. Forcing an application which may have hundreds of users in a CICS region to process one request at a time is very bad system desgin.

3. CICS programmers usually use TD queues, VSAM file records, or TS queues (depending upon their needs) to communicate between tasks since pseudoconversational tasks end when the RETURN is performed.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 17, 2011 6:08 pm    Post subject:
Reply with quote

Quote:
make sure that PRGM2 is executed by one user at a time until it completes its work.


you need to have a better understanding of CICS.

the whole concept of CICS is to allow more than one user to use the same program simultaneously

now, if you want help redesigning this mess,
tell us what is going on.
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Fri Aug 19, 2011 9:48 am    Post subject:
Reply with quote

Hi All,

Thanks for your comments.

Quote:
the whole concept of CICS is to allow more than one user to use the same program simultaneously

I understand.
But i want to restrict our users to simultaneously invoke ONLY the tran 'ABCD' not all the options(Tran ID) in our application Menu. If they invoke the tran 'ABCD' simultaneoulsy, it makes some unwanted entry in more than one datacom table. I dont want it to happen.

Mean time, i will try to find the option to handle this situation in the program PRGM2 itself.

Regards,
Sukumar.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Aug 19, 2011 10:34 am    Post subject: Reply to: How to take the LOCK on particular Transaction
Reply with quote

Review TRANCLASS, where you can set the max active tasks (such as 1), associated with a given transaction, allowing single transaction (serial) execution.

However, care must be taken because if the target transaction could potentially be of random high-use (usage spike) and/or is inherently long running, then this could be detrimental to the entire region overall.

Speak with system's personnel so they can work up some metrics on this transaction's use and average response time and come to a conclusion whether a unique TRANCLASS would be one method of serialisation.

Bill
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 Aug 19, 2011 10:45 am    Post subject:
Reply with quote

Hello,

Quote:
If they invoke the tran 'ABCD' simultaneoulsy, it makes some unwanted entry in more than one datacom table.
All this says is there is a design flaw. . .

You do not have a cics issue (imho), you have a database processing issue.

How often does it happen that multiple users need to run this transaction at the same time?

What we have done at several of my Datacom clients to resolve this (others have made the same mistake) is to read a particular row in some control table (if one does not exist, create one). Read the row used to control this single-threading for the abcd process with lock/update. Once the process completes, free the row. This read for update would have to be put into every process that could invoke the abcd process. If there is only one, there would be very little to change in the existing code.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 3 Thu Jan 19, 2017 1:31 am
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm


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