spongebob Posted October 14, 2020 Share Posted October 14, 2020 (edited) Hello Forum, Im writing a script for my locally hosted FM Database that will manipulate quite a few records in the database. Basically when a user changes the name of an item to something they type in, I must go into several tables to change other values depending on what was typed in accordingly. In a nutshell I must enter 2-3 tables, do a find, modifiy the records and then do the same on the next table and so on. All that is no problem. The question I have is this: How can I make this procedure, "indivisible"? What I aim to achieve is that while this routine is running, noone will interfere with it. If another user changes the name of the item at aroundabout the same time, the whole thing could fail, because then all the finds and mods will get confused with one another. For situations like this im always used to creating a field that I use as a semaphore. At the start of the script I set a flag in that field, and if someone else wants to execute the script at the same time, the scrip will refuse because the semaphore is set. However I wonder how elegant that is (both scripts could still try to set the semaphore at the same time?). Is there a way I can let the OS handle this? Would it help if I execute the script on the server? Disallow script Aborting? How can I make the script as indivisible as possible so that only one person can run it at any one given time, and were pretty much guaranteed that? Is there a way to do that at all? Thanks for ideas! Spongebob Edited October 14, 2020 by spongebob Link to comment Share on other sites More sharing options...
This topic is 675 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now