Preventing Infinite Loops

A script that results in an infinite loop (also known as a stack overflow) is a serious error which can cause a server process to terminate unexpectedly. Although Data Relationship Management attempts to prevent such scripts from executing, you should exercise caution when writing self-referencing, or recursive, scripts. Always test new scripts in a development environment before deploying to production.

A simplified example of a script that will loop infinitely is shown below. Because the script includes a call to itself, but never terminates execution, the engine executing the function will eventually terminate due to lack of resources. Lastly, because the script never calls the Data Relationship Management engine, there is no chance to catch the overflow and stop the script.

function badFunc(a) { badFunc(a); }
badFunc("oops");