View previous topic :: View next topic
|
Author |
Message |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|