Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any good ideas how to automatically log-off users ??
Message
De
08/09/1999 19:57:47
 
 
À
08/09/1999 17:53:16
Bruce Covey
Home Depot Television
Atlanta, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00262619
Message ID:
00262669
Vues:
12
>In order to do an occassional PACK of the DBC/DBFs, I wondered if there was a convenient way to log-off all users so I can get EXCLUSIVE use in the early morning hours.
>
>I wondered what would happen if the READ EVENTS command was in a
>DO...WHILE loop that monitored the system clock
>

You might want to look at having a timer poll periodically and force a shutdown if it found the time was outside of normal operting hours; you'll need to issue appropriate TABLEREVERT()S and ROLLBACKs for any forms that were up and had data in buffers that hadn't been committed.

Inevitably, I've gotten burned by such strategies in two ways - first (and most frequently) people on occasion work outside of normal business hours. An automatic time shutdown should give the user the option to do several different things; bail immediately as if they weren't sitting there typing away, exit gracefully, and if necessary delay the start of the routine maintenance task (a better choice is to give them enough warning time to let them exit gracefully, and then if a second timer event fires, sht them down as if they weren't listening) or finally, to delay or bypass the scheduled maintenance task.

The second and far more distressing issue is that the station is in an uninterruptible task when the time to shut down happens by. VFP won't respond to a UI event inside a single line of code or at times even a procedure or methods - a complex query or report may not respond to a signal to shut down the app. Here, the best strategy will either be to have the maintenance task check for all necessary resources and spin for a time waiting for things to free up, and then abort if they don't become available.

You can force a disconnect at the operating system level (NT and NetWare both have facilities to force disconnections, and you can also start something to force the workstation to reboot spontaneously at a given time.) In all cases, this results in a messy shutdown, and if people have things in local buffers, the database is going to suffer some data loss, and possible corruption, as a result. Imagine if Cinderalla were on the New Jersey Turnpike in the Pumpkin Coach at 12:01 AM, when it spontaneously went from coach and horses to overripe pumpkin and rats at 70MPH on I95...you get the general idea.

The really bad news is that this strategy is the only one that will let you run the maintenance task if someone opened one of the tables outside of your app - without the intervention of an app to release stuff for you, your maintenance task gets hosed if someone opened one of the lookup tables with Excel or VFP to look at it and left it open when they went home. It's really bad when you, the programmer who should have known better, are the one who did it...

My recommendation is to use a timer to request the release of resources from workstations in your application, and have your maintenance tasks defer or abort, documenting everything in detail about what wasn't available for exclusive use when it couldn't do its job.

>i.e. At 1:00am, the program would run a shutdown routine.
>
>Any ideas or suggestions would be appreciated.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform