KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Preventing duplicate stored procedure processes in 4D Server
PRODUCT: 4D Server | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: October 5, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

You may need to launch a stored procedure, but you may want to prevent launching it twice in two separate server processes. Some possible solutions include:

- Setting an interprocess variable flag which indicates the process has been started.
- Checking the properties of each running process to determine if a process has already been launched for this stored procedure.
- Setting a semaphore, which is easier and safer to use than an IP variable. Once the semaphore has been set, you know that you don't need to launch another process.

However, the easiest solution is to use the optional * parameter in your Execute on Server command. The presence of this parameter tells 4D to check if an exisiting process with the same name already exists. If one does, then a new process will not be created and instead 4D Server will simply return the existing process number.