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 ensure the concurrency in TSQ?

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

New User


Joined: 28 Jun 2014
Posts: 21
Location: INDIA

PostPosted: Sat Jun 28, 2014 3:23 pm    Post subject: How to ensure the concurrency in TSQ?
Reply with quote

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
View user's profile Send private message

prino

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Sat Jun 28, 2014 5:40 pm    Post subject:
Reply with 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!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sat Jun 28, 2014 7:37 pm    Post subject:
Reply with quote

You need to research ENQ and DEQ CICS API commands.
Back to top
View user's profile Send private message
ShobhitVerma10april

New User


Joined: 28 Jun 2014
Posts: 21
Location: INDIA

PostPosted: Mon Jun 30, 2014 11:41 am    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Mon Jun 30, 2014 9:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ShobhitVerma10april

New User


Joined: 28 Jun 2014
Posts: 21
Location: INDIA

PostPosted: Mon Jun 30, 2014 11:42 pm    Post subject:
Reply with quote

Hi Rohit ,

Read about Shared & Non Shared TSQ. You will get better idea.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Jul 01, 2014 12:40 am    Post subject:
Reply with quote

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
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 Ensure that all generation of a GDG a... Deepakgoyal2005 JCL & VSAM 8 Sat Jan 23, 2010 7:35 pm
No new posts To ensure whether a PDS Member exists... HameedAli CLIST & REXX 4 Wed Aug 26, 2009 2:31 pm
No new posts PL1 Error: "ENSURE STRINGS DO N... op ABENDS & Debugging 2 Thu Nov 30, 2006 3:25 pm
No new posts How can I ensure that only 1 user pic... piglet CICS 7 Tue Sep 05, 2006 7:59 am


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