Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Users on a system
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00114314
Message ID:
00116650
Views:
15
>>>>>Is there any way to determine how many users are logged into a FoxPro app? I need for some processing to take place if a user is the last one to exit an app.
>>>>
>>>>You could have a table that a user write their login time to when entering the app and writes their logout time when exiting. Each time a user exits just check to see if their are any records with no logout times.
>>>
>>>This of course assumes the system never crashes, leaving a logged-in user.
>>>
>>>Barbara (playing devil's advocate again)
>>
>>You can also create a users table and RLOCK the relevant record when user logg in. On exit , just unlock. You can get the logged-in users by checking locked records. This works even if system crash.
>
>We tried this, and found that there was a 5-20 minute wait for the record to be unlocked when we simulated a crash by pulling the plug on the computer. On a couple of occasions, we had to use Network Utilities to unlock a record.
>
>Not acceptable to users, so we went with other methods.

Hello!

I tested it with Novell, and I found, if a machine is crashed, logged into the network again, it CAN lock the record again, which was previously locked by this machine before the crash. So, user can use the app, without waiting.

But, there is an other problem with it, if you test the number of logged users by locking the record, (even if you try only one record a time) some or one available "free" user place is occupied by the test. So if X is number of the available max logged users, and there are X-1 logged users, and somebody try to log into your app, and a test is running in the same moment on an other machine, the user cannot log in, but theoretically the is a free user place.
So, you have to use a semaphore record, locking this record, can show, that a test is running, so another task have to wait for awhile.

BB
Previous
Reply
Map
View

Click here to load this message in the networking platform