Good tips....but this reminds me that I'm soooo glad I switched over to using MySQL in 2004 after seeing Bob Lee's presentation at WhilFest. I never have that problem since then.
On 7/23/2019 4:34 PM, Ted Roche wrote:
On Tue, Jul 23, 2019 at 12:36 PM Ken McGinnis kamcginnis@gmail.com wrote:
We could try to lock the exe and that would fail so we would know someone else is using the software. However, if that other user is working with data in a different folder, we don't care so we do not want to lock the exe.
Create a dummy table, "InUse" with a a single record in each folder. When your user goes to use that folder, they try to lock the single record inside a TRY... CATCH. If it fails, it means they can't do any of the functions that would require exclusivity.
The problem is when the 2nd user comes in and needs to lock many
or all files to reindex or other procedures. How can the 2nd user know that another user is there?
In one of our apps, we have an "Everyone Out!" menu pad where we store all the administrative functions. The functions there try to use the shared DBC exclusive and that's the semaphore that they can proceed. No one else can log into the app until the DBC is released, and that happens when they're done with their function, or if they crash, so it automatically cleans up.
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus