This is working as designed.  Every time you submit a command-line STAF 
request (STAF local .....) a unique STAF handle number is used for that 
request, and the Timer service uses the handle number as part of the 
unique data for the Timer registration.  That's why you see 2 similar 
entries in the LIST TIMERS LONG output, but each with a different 
"Notifiee" (the STAF handle number used for the REGISTER request, in this 
case 98 and 99).

You can create a static STAF handle (so that all command-line requests use 
the same handle number) to get the behavior that you were expecting:

$ STAF local HANDLE CREATE HANDLE NAME TestHandle
Response
--------
21

$ export STAF_STATIC_HANDLE=21

$ STAF local TIMER REGISTER TYPE heartbeat FREQUENCY 60000 KEY heartbeat
Response
--------

$ STAF local TIMER REGISTER TYPE heartbeat FREQUENCY 60000 KEY heartbeat
Error submitting request, RC: 49
Additional info
---------------
HEARTBEAT LOCAL://LOCAL 21 HEARTBEAT

$ STAF local HELP ERROR 49
Response
--------
Description: Already exists
Details    : This indicates that the item you specified already exists.

Note: Additional information regarding the item which already exists may 
be prov
ided in the result passed back from the submit call.


David Bender
STAF/STAX Development
8-1268 (512-838-1268) 
IBM Austin Bldg. 903-5B002
Internet: [EMAIL PROTECTED]




Harsha <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
02/07/2008 01:09 AM

To
[email protected]
cc

Subject
Re: [staf-users] unable to explicitly unregister a timer entry






Further:

STAF is allowing me to register two timers with the same type/key 
whatever.

mommy :( confusion++ 

The Timer Doc says:
Note: If a timer already exists with the same TYPE, registering machine 
and process or handle, and key, you will get an Already Exists error code 
returned.

-- Command History --

E:\>staf local TIMER list TIMERS LONG
Response
--------


E:\>staf local TIMER REGISTER TYPE heartbeat FREQUENCY 60000  KEY 
heartbeat
Response
--------


E:\>staf local TIMER REGISTER TYPE heartbeat FREQUENCY 60000  KEY 
heartbeat
Response
--------


E:\>staf local TIMER list TIMERS LONG
Response
--------
[
  {
    Type                   : HEARTBEAT
    Machine                : local://local
    Notify By              : Handle
    Notifiee               : 99
    Key                    : HEARTBEAT
    Last Fired Date-Time   : <None>
    Frequency              : 60000
    Priority               : 5
    Unregister On No Path  : global
    Unregister On No Handle: global
  }
  {
    Type                   : HEARTBEAT
    Machine                : local://local
    Notify By              : Handle
    Notifiee               : 98
    Key                    : HEARTBEAT
    Last Fired Date-Time   : <None>
    Frequency              : 60000
    Priority               : 5
    Unregister On No Path  : global
    Unregister On No Handle: global
  }
]

On Feb 7, 2008 12:27 PM, Harsha <[EMAIL PROTECTED]> wrote:
Hi All

For the first time I am using the STAF timer plugin. I was able to plug it 
successfully in to the STAF runarea.
the timer service is also getting listed in the service list of the STAF 
instance that is running.

However I am not able to explicity unregister a timer entry.

Instead I see the following error message. The time documenation for 
UNREGISTER event says:
 
The result buffer will contain an error message if an error occurred and 
will be empty otherwise. 

I am obfuscated that:

Am I using the right command syntax to unregister a timer?
or the way I have plugged the Timer service is not proper?
or if the STAF Timer plug-in itself has defect (which I doubt)?

help me overcome this obstacle, please.


-- STAF, plug-in INFO---

STAFProc version 3.2.3 initialized
Timer Service, Version 3.0.1 

--- Command History----

E:\>staf local service list
Response
--------
Name     Library    Executable
-------- ---------- ------------------------------------
DELAY    <Internal> <None>
DIAG     <Internal> <None>
ECHO     <Internal> <None>
EVENT    JSTAF      E:/STAF/services/stax/STAFEvent.jar
FS       <Internal> <None>
HANDLE   <Internal> <None>
HELP     <Internal> <None>
LOG      STAFLog    <None>
MISC     <Internal> <None>
PING     <Internal> <None>
PROCESS  <Internal> <None>
QUEUE    <Internal> <None>
SEM      <Internal> <None>
SERVICE  <Internal> <None>
SHUTDOWN <Internal> <None>
STAX     JSTAF      E:/STAF/services/stax/STAX.jar
TIMER    JSTAF      E:/STAF/services/timer/STAFTimer.jar
TRACE    <Internal> <None>
TRUST    <Internal> <None>
VAR      <Internal> <None>


E:\>staf local TIMER REGISTER TYPE heartbeat FREQUENCY 60000  KEY 
heartbeat
Response
--------


E:\>staf local TIMER list TIMERS LONG
Response
--------
[
  {
    Type                   : HEARTBEAT
    Machine                : local://local
    Notify By              : Handle
    Notifiee               : 88
    Key                    : HEARTBEAT
    Last Fired Date-Time   : <None>
    Frequency              : 60000
    Priority               : 5
    Unregister On No Path  : global
    Unregister On No Handle: global
  }
]

E:\>staf local TIMER UNREGISTER TYPE heartbeat MACHINE local://local 
HANDLE 88
Error submitting request, RC: 48
Additional info
---------------
The TYPE specified does not exist for the specified machine and handle 
number/na
me (and key if specified)

E:\>staf local TIMER list TIMERS LONG
Response
--------
[
  {
    Type                   : HEARTBEAT
    Machine                : local://local
    Notify By              : Handle
    Notifiee               : 88
    Key                    : HEARTBEAT
    Last Fired Date-Time   : <None>
    Frequency              : 60000
    Priority               : 5
    Unregister On No Path  : global
    Unregister On No Handle: global
  }
]

E:\>staf local timer unregister type HEARTBEAT key HEARTBEAT
Error submitting request, RC: 48
Additional info
---------------
The TYPE specified does not exist for the specified machine and handle 
number/na
me (and key if specified)

E:\>staf local TIMER list TIMERS LONG
Response
--------
[
  {
    Type                   : HEARTBEAT
    Machine                : local://local
    Notify By              : Handle
    Notifiee               : 88
    Key                    : HEARTBEAT
    Last Fired Date-Time   : <None>
    Frequency              : 60000
    Priority               : 5
    Unregister On No Path  : global
    Unregister On No Handle: global
  }
]

E:\>staf local timer unregister type HEARTBEAT
Error submitting request, RC: 48
Additional info
---------------
The TYPE specified does not exist for the specified machine and handle 
number/na
me (and key if specified)


-- 
Cheers!!
Harsha Reddy



-- 
Cheers!!
Harsha Reddy

----------------------------

Of kind hearted people, (their) ear glows by (the knowledge) heard (by the 
ear) & not by the ear ring (worn on ear), (their) hand glows by the 
donation (given) by the hand & not by bracelet (worn on wrist), their body 
glows by the selfless deeds done (by them to others) & not by (anointment 
with) sandalwood (oil). 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to