View previous topic :: View next topic
|
Author |
Message |
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
If there is a program A, which triggers program B with a transaction, but there is no data or commarea being passed to B. How can program B access the storage address/data present in commarea of A? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Why should an independent program have any access to some other program?
If program B needs access to something from program A, they both need to follow some convention. . . |
|
Back to top |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
If there is no data or commarea passed to B program, then it can't access the commarea storage of A program. As Dick advised what is the neccessary of calling B program when an independent program have any access to some other program.
Please correct me if am wrong |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
There's a term in CICS for the case of program B attempting to access program A's COMMAREA or other data, and that term is STORAGE VIOLATION. CICS specifically protects against this type of access. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
sachin.mandaliya wrote: |
If there is a program A, which triggers program B with a transaction, but there is no data or commarea being passed to B. How can program B access the storage address/data present in commarea of A? |
As Robert said, that could end up being a storage violation.
But, if protected or in some way made available, the address could be saved by A in a TS/TD queue that B could retrieve. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
if you do get addressability to Program A's working storage from a
different transaction.
move some data to it from Program B. Let us know what happens !!
|
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
But, if protected or in some way made available, the address could be saved by A in a TS/TD queue that B could retrieve |
But what could protect it? This is a storage area of a task that may well have ended, freeing up all its storage. The passed pointer could be pointing at anything! If Task A continues for long enough, in parallel to Task B, what's to prevent either from modifying storage that the other's using?
If storage could be protected past task-end, how could clean-up be achieved? There may be potential for a memory-leak here....
Garry. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Garry Carroll wrote: |
But what could protect it? This is a storage area of a task that may well have ended, freeing up all its storage. The passed pointer could be pointing at anything! If Task A continues for long enough, in parallel to Task B, what's to prevent either from modifying storage that the other's using? |
Minor design problem, but it is solvable. For instance, task A starts non-terminal B and then waits on an ECB for B to finish....
Quote: |
If storage could be protected past task-end, how could clean-up be achieved? There may be potential for a memory-leak here.... |
Proper design would prevent attempted access to freed storage. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
For instance, task A starts non-terminal B and then waits on an ECB for B to finish.... |
Yes, but isn't this kinda like going back to conversational technique? All that program and task storage tied-up while waiting for Task B to POST the ECB ! A bit like hogging storage while waiting for the terminal user to return from coffee/lunch...
I guess we're only discussing theoretical ways of doing something that can be better achieved by proper design in the first instance.
Garry. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
Yes, but isn't this kinda like going back to conversational technique? |
In an application I worked on, the CICS transaction was entirely pseudo-conversational but had to wait for either the other task to succeed or timeout. The other task did an external request to another site that sometimes failed to complete in a timely manner. |
|
Back to top |
|
|
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
Thanks guys for your answers....
Actually I have been asked this question in some interview and I had some doubts about it. Now they are cleared. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Sachin,
out of courtesy, please identify with original posting for questions that come from an interview process.
|
|
Back to top |
|
|
|