Replace Background Question (AREV Specific)
At 30 DEC 1998 09:52:00PM Jim Horvath wrote:
I have long had a problem with AREV users who leave their computers turned on overnight thereby messing up the AREV backups. Since I have a dedicated indexer that automatically suspends at night using the indexing post hook, I figured it must be possible to do something similar to log out users.
I searched out a couple of old posts from this site and wrote a replace background process that checks the time and exits AREV after hours. It looks something like this:
Subroutine ReplaceBackground
done=0loop until doneinput x, -1if x then@DATA:=xdone=1endif time() ] 64800 thenexecute("logoff")endrepeatreturn
I set up a test user and tried it, and it seems to work, but I'm a little bothered by the idea of exiting AREV from within a subroutine. Is it OK to do this? Will this shut down AREV properly, i.e. close all files, release EMS memory, etc.?
At 30 DEC 1998 11:24PM Larry Wilson wrote:
Actually, it's fine except that instead of executing LOGOFF, using the AREV system subroutine EXIT_SYSTEM.
The syntax is: call EXIT_SYSTEM(any message you want, or null for none). I use it in my AUTOEXEC routine that is posted in the next message up. EXIT_SYSTEM flushes indexes (waits for BATCH.INDEXING, using by F.INDEXER I believe) to finish before actually logging off, whereas LOGOFF will interrupt indexing and just exit. I've replaced all of my OFF and LOGOFF verbs with calls to EXIT_SYSTEM; I have NO idea why RTI even allows OFF and LOGOFF instead of using EXIT_SYSTEM.
Go figure.
Larry Wilson
TARDIS Systems, Inc.
"Will work for gas for my Harley"
At 31 DEC 1998 09:11AM akaplan@sprezzatura.com - [url=http://www.sprezzatura.com]Sprezzatura, Inc.[/url] wrote:
Batch.Indexing does not appear to be called in all that many places. It's in the batch update processors (completely unrelated batch thing), copyrow, deleterow, the lotus imports, the dBASE III imports, transaction stuff, and probably the ! code in an index, since it's in SITRANS.RUN.
However, due to the nature of all these programs, by the time the replace background process kicks in, all of them will have unloaded the batch except for the transaction stuff. Having said that, the developer should be aware enough to process his transactions before logging off, so batch.indexing should not be a big concern.
Exit_System does have the advantage of detaching all volumes and issuing a flush call to ensure that bonded files are properly dismissed and any network buffer is written out. Calling Exit_System directly though, does not update the TCL stack.
Since PERFORM 'OFF' does save off the command stack and calls Exit_System, using OFF intead of little documented subroutine would seem to be the best approach, at least in my humble opinion.
akaplan@sprezzatura.com
At 02 JAN 1999 10:06AM Larry Wilson wrote:
Aaron,
Thanks for pointing that out about the 'OFF' command; it's just that in all the time I've been using AREV I've never seen anything that said that off executed EXIT_SYSTEM; then again, I don't think I've every really sat down and read all of the docs. And while OFF and LOGOFF (I believe) save off the command stack, and if memory servers, the saving doesn't do much good unless you put some code in to retrieve it at the next logon. Then again, I may just have missed something there.Larry
At 02 JAN 1999 02:57PM akaplan@sprezzatura.com - [url=http://www.sprezzatura.com]Sprezzatura, Inc.[/url] wrote:
Actually, only OFF does the TCL save, if required by the environment flags. LOGOFF shuts down completely. The stack is reloaded from Initialize().
Here's the scoop
OFF - Clears cursors, writes out command stack, deals with print proccessors and transactional processing stuff, resets video, unlocks remaining records, calls EXIT_SYSTEM
EXIT_SYSTEM - Flushes batch indexing, flushes all file systems, detaches all volumes through normal detach process, displays logogg message, calls LOGOFF opcode
LOGOFF - Flushes memory buffers, resets DOS pointer and internals, deallocates memory, exits engine, returing you the the command prompt.
So, depending on which items you want processed, and which you feel can be safely ignorned, you can start at any point in the tree.
For everyone else, remember, Revelation only documented some programs because of demand, not because they thought they should be used by developers. The safest way to logoff the system is through the OFF command. The rest have been documented so Revelation couldn't be accused of keeping secrets.
akaplan@sprezzatura.com
At 02 JAN 1999 11:14PM Victor Engel wrote:
HR-1 has an additional exit point. There is a command called EXIT, which does additional things, such as deleting temporary fields, etc. I've never really figured out what all it does, but I believe it eventually calls "OFF".