I do a variation on this -- since my phantoms now need to be 'multi-account'
(that is, 6 accounts, I need 6 phantoms - one per account) -- I do a READU
of an 'item' from a 'Paramters' file  -- the "ItemID" I attempt to read is 

"AcctName-PHANRUN"

Don't care if it exists or not -- as long as the READU 'passes'  -- if the
LOCKED clause hits, I exit the 'startup'...  I put this logic into a process
I call during the LOGIN paragraph -- not flawless, in that people have to
move in and out of the account, but for what I do, it works A-OK.

This way, if another account needs to 'starts up' it can tell if the phantom
for that account's data already has a phantom 'running' or not.  Uses READU
so that regardless of how the phantom dies, the lock goes with it.  And more
flexible than the "LOCK 60" type of lock.

DW

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Doug
Sent: Friday, April 02, 2010 10:57 AM
To: 'U2 Users List'
Subject: Re: [U2] UD: Phantoms

Bill:

Use the LOCK command with number 0 through 63.  Have your phantom process do
a "LOCK 60".  Then you can test it in other programs using the else clause:

LOCK 60 THEN
  UNLOCK 60
* Restart phantom
END ELSE
* Phantom is running do nothing
END

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Bill Haskett
Sent: Friday, April 02, 2010 9:25 AM
To: U2 Mail List
Subject: [U2] UD: Phantoms

In UniData, does anyone know of a sure way to determine if a BASIC 
program is running as a phantom?

We have a background service program in our application that has to be 
running as a phantom whenever UniData starts.  The ability to start 
something when the dbms starts doesn't exist in UniData, so I have to 
schedule the task when Windows starts.  However, if the program stops 
(or UD was stopped and restarted) I have no sure way to know if it's 
running.

Does UD have any way to know this?

Thanks,

Bill Haskett
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to