Bodo,

After looking into this issue some more, I don't believe this is a bug. 
The STAX User's Guide, in the section on the <finally> element, describes 
the situation you are seeing as follows:

Note that if you want to have a guaranteed way to stop a finally task, you 
should have the first element contained in your finally task be a block or 
timer element. For example, if you submit a request to terminate the job, 
it will not terminate the job until the finally task(s) complete. But if 
you submit a request to terminate a block that is currently running which 
is contained within a finally task, then the block will be terminated (it 
will not wait until that finally task completes). 

So, you should change your STAX job so that the first element contained in 
your finally task is a <block> or a <timer> element.  If you add a <block> 
as the first element in your finally task, then you can terminate that 
block to terminate the finally task.  For example:

       <block name="'Block2'">
         <try> 
  
            <log message="1">
             'In Block2 in "try" body'
           </log> 
  
            <finally>
              <block name="'FinallyBlock'">
                <sequence> 
  
                  <log message="1">
                   'In Block2 before hold (in "finally")'
                 </log> 
  
                  <hold/> 
  
                  <log message="1">
                   'After hold in Block2.  Should not be logged if Block1 
or Block2 is terminated before Block2 is released'
                 </log> 
  
               </sequence>
             </block>
           </finally>

         </try>
       </block> 

Now you will be able to terminate the "FinallyBlock" block so that you 
have a guaranteed way to stop a finally task (so that the STAX job will be 
able to complete).

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Strösser, Bodo <bodo.stroes...@ts.fujitsu.com> 
06/26/2009 03:39 PM

To
Sharon Lucas/Austin/i...@ibmus
cc

Subject
RE: [staf-users] Wrong picture on STAXMon when terminating a block






Hi Sharon,
 
could you please open the bug? I never did it before and it's very late 
here in Europe.
I would prefer to go home now.
 
Thanks in advance!
 
Bodo

From: Sharon Lucas [mailto:luc...@us.ibm.com] 
Sent: Friday, June 26, 2009 10:14 PM
To: Strösser, Bodo
Cc: 'staf-users@lists.sourceforge.net'
Subject: Re: [staf-users] Wrong picture on STAXMon when terminating a 
block


Thanks for providing a recreation scenario for this problem.  Please open 
a bug via http://staf.sourceforge.net.  Or, if you prefer, I can open a 
bug for you.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313



Strösser, Bodo <bodo.stroes...@ts.fujitsu.com> 
06/26/2009 03:06 PM 


To
Sharon Lucas/Austin/i...@ibmus, "'staf-users@lists.sourceforge.net'" 
<staf-users@lists.sourceforge.net> 
cc

Subject
Re: [staf-users] Wrong picture on STAXMon when terminating a block








Hi Sharon, 
  
thank you for your fast reply. 
  
I tried your job and it works fine, but not my job. So I did some more 
testing 
to find the difference. Here it is: I am using </hold> in the <finally> 
part of a <try>. 
The following modified "block2", reproduces the problem as I describedit 
in my 
irst mail: 
  
        <block name="'Block2'">
         <try> 
  
            <log message="1">
             'In Block2 in "try" body'
           </log> 
  
            <finally>
             <sequence> 
  
                <log message="1">
                 'In Block2 before hold (in "finally")'
               </log> 
  
                <hold/> 
  
                <log message="1">
                 'After hold in Block2.  Should not be logged if Block1 or 
Block2 is terminated before Block2 is released'
               </log> 
  
              </sequence>
           </finally>
         </try>
       </block> 
  
Knowing the reason for the problem, I probably can work around it. At 
least it 
should be written to the known bugs, I Think. 
  
Best regards 
Bodo 
  
  
  
From: Sharon Lucas [mailto:luc...@us.ibm.com] 
Sent: Friday, June 26, 2009 7:41 PM
To: 'staf-users@lists.sourceforge.net'
Cc: Strösser, Bodo
Subject: Re: [staf-users] Wrong picture on STAXMon when terminating a 
block


When a block is terminated, that block and all of its child blocks are 
terminated.  So if you terminate a black that has a held child block, the 
terminate should override the held block and terminate the entire block 
that you asked to be terminated.  Note that the STAX Monitor simply 
submits HOLD, TERMINATE, RELEASE, etc requests to the STAX service, so its 
the STAX service, not the STAX Monitor that handles holding, terminating, 
and releasing blocks.  The STAX Monitor simply gets messages (via the 
Event service) to update it on what actions have taken place in the job). 

The following STAX job demonstrates this.  If you run this job, it will 
hold Block2.  If you terminate Block1 (Block2's parent) or Block2 without 
first releasing Block2, then  message "After hold in Block2.  Should not 
be logged if Block1 or Block2 is terminated before Block2 is released" 
will not be logged and the job will then run Block 3.  This is working as 
designed.  Post again if this did not answer your question. 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>   
<!DOCTYPE stax SYSTEM "stax.dtd"> 
<stax> 

<defaultcall function="StartHere"/> 

<script> 
 machine = 'local' 
</script> 
 
<function name="StartHere"> 
 <sequence> 

   <block name="'Block1'"> 
     <sequence> 

       <block name="'Block2'"> 
         <sequence> 

           <log message="1"> 
             'In Block2 before hold' 
           </log> 
 
           <hold/> 

           <log message="1"> 
             'After hold in Block2.  Should not be logged if Block1 or 
Block2 is terminated before Block2 is released' 
           </log> 

         </sequence> 
       </block> 
 
     </sequence> 
   </block> 
 
   <block name="'Block3'"> 
     <sequence> 

       <log message="1"> 
         'Logged by Block3 which is run after Block2 completes' 
       </log> 

       <stafcmd name="'Delay for 5 seconds'"> 
         <location>'local'</location> 
         <service>'DELAY'</service> 
         <request>'DELAY 5s'</request> 
       </stafcmd> 

     </sequence> 
   </block> 

 </sequence> 
</function> 
</stax> 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313


Strösser, Bodo <bodo.stroes...@ts.fujitsu.com> 
06/26/2009 11:53 AM 


To
"'staf-users@lists.sourceforge.net'" <staf-users@lists.sourceforge.net> 
cc

Subject
[staf-users] Wrong picture on STAXMon when terminating a block










Hi, 
 
i'm using STAX 3.3.6 
 
I think, there is a bug in STAXMon, that can be reproduced performing the 
following 
steps: 
 
- A STAX job holds the innermost block of itself using <hold/>. 
- Now we kill a parent block, as we want some part of the job to be 
skipped when 
 the block in "hold" is released. 
- As soon as the parent block is terminated from STAXMon, STAXMon no 
longer 
 displays the terminated block's childs, which I think is wrong. 
- As the block in "hold" no longer is displayed, it can not be released 
via STAXMon. 
 
When the Monitor window is closed and started again, the missing blocks 
are back. 
 
Best Regards 
Bodo
------------------------------------------------------------------------------
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to