So, the scenario is that your code gets control running under task A,
and will attach task B.
You want to get control when task A is terminating normally, so you can
detach task B.
I don;t know if an estae routine on task A would allow you to detach
task B from the estae. Probably would, But if task A is already in
termination for trying to exit without detaching, then you probably
can't retry out of the estae, the only thing you could do is percolate,
so what's the point. You would have to try it, and see what happens.
If task A is not the jobstep tcb, you could consider scheduling an IRB
onto the jobstep tcb to attach the sub-task. Then, set a resource
termination manager for task A. That code could detach the sub-task
when task A terminated, and before the jobstep task terminated.
--Dave
On 10/16/2014 1:07 PM, Victor Gil wrote:
The 1st task is NOT my code, but it would CALL my service which would attach a
subtask. This one will be totally under my control
===================================================
Is the 1st task, the one with the existing DB2 connection, your task?
Do you have control of it, or is your code running on a tcb that is not
your code?
On 10/16/2014 1:00 PM, Victor Gil wrote:
Hi everyone,
Working on a general purpose callable subroutine to connect to a remote DB2
subsystem and return values back to the caller.
Since the caller may [and WILL] have established its own DB2 connection to a
local DB2 subsystem, possibly with some cursors open and DB2 locks acquired,
the subroutine must run under a different TCB.
I have no problems attaching a subtask on a first call and connecting from it to a remote
subsystem, but I cannot force the caller [because this would mean massive change to the
existing source code] to also call me with the "end-of-job" request, so that I
can properly detach the subtask.
And if it is not detached the main task will surely get abended. [By the way -
can't this get trapped by an ESTAE(X) and converted into RC=0?]
Given the above scenario - does anyone have a suggestion on how to quietly
terminate both tasks without the detach? Or maybe a suggestion on ANOTHER way
of implementing the required functionality?
Many thanks in advance!
-Victor Gil-
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN