I have a program that 10-20 people use throughout the day. Because things are rapidly fluctuating I occasionally have to take the database offline, or restart the server for other reasons. I’d like to have a better way to make sure no one is currently in the program than walking to each person and asking them.
I don’t want to re-invent the wheel if something like this already exists.
The thoughts I had were:
- Create a database “history” entry each time users open or close the program to see who is currently using the system.
- Use WCF to have the clients “tell” the server that they are connected every X seconds.
Are there better or easier solutions to this problem?
One solution would be to create a database table where everytime someone logs on, a record is created for them. Every 15 mins it updates with the last update time. When they close, it deletes the record. If any record is more than 15 mins long, it is an app crash.
Its crude but it works, you then have a simple DB query to run.