View previous topic :: View next topic
|
Author |
Message |
ShobhitVerma10april
New User
Joined: 28 Jun 2014 Posts: 21 Location: INDIA
|
|
|
|
I have a question :
Assume there is a queue Q1 and it has value 5 in ITEM4
Then User A go and read ITEM4 of Q1 add 10 in its value and store it in working storage area . Then User B read ITEM 4 of Q1 add 15 in its initial value and store in its working storage area . Then User A writes and User B also.
I want to know what will be the final value of ITEM 4 , & how does it ensure that anyone data won't lose.
User A READ Q1(ITEM4)
User B READ Q1(ITEM4)
User A WRITE into Q1(ITEM4)
User B WRITE into Q1(ITEM4) |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Two users should never ever be able to access the same TSQ for update at the same time, there's something fundamentally wrong with your design! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You need to research ENQ and DEQ CICS API commands. |
|
Back to top |
|
|
ShobhitVerma10april
New User
Joined: 28 Jun 2014 Posts: 21 Location: INDIA
|
|
|
|
Hi Prino ,
I got my answer from one of the reply from Mr. Bill .......... Here it is :
You CAN use the same TSQ, although you really should have separate TSQ's.
To guarantee integrity, you must use ENQ and DEQ API's, which enforces serial access, using a RESOURCE name known by every program which accesses the TSQ. Otherwise, TSQ data integrity will be in question, similar to what you're dealing with now.
You may want to review your TSQ naming convention and build the TSQ name unique to the user and the transaction-id.
TSQ names can now be up to 16-Bytes long, so you have the opportunity for uniqueness.
One last recommendation; Delete the TSQ when you're done or issue a DELETEQ (specifying NOHANDLE) when you're about to write the first TSQ Item (TSQ creation).
Commarea usage can replace the TSQ's. If you're short on extra commarea space, take a look at CONTAINERS, introduced with CICS/TS 3.1.
Thank you Mr Bill |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Quote: |
Two users should never ever be able to access the same TSQ for update at the same time, there's something fundamentally wrong with your design! |
This is very much possible case, and ENQ can be used for transaction sequencing as discussed.
But do you have any better design or solution on this which could be very helpful to know? |
|
Back to top |
|
|
ShobhitVerma10april
New User
Joined: 28 Jun 2014 Posts: 21 Location: INDIA
|
|
|
|
Hi Rohit ,
Read about Shared & Non Shared TSQ. You will get better idea. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Hi,
Thanks for the thought but Yes, I am aware of these topologies. Your requirement was how do we get it with same TSQ name as shown "Q1". Hence, Enq was the choice as told by others too, but if you could have asked for more proposed solutions to this problem then as you said Non Shared TSQ, Containers can be more choices left with you.Also it is always not necessary that you will get unique Terminal name in the request and then it goes difficult to maintain unique TSQ name and hence ENQ is generally used for SOA's. |
|
Back to top |
|
|
|