You need to sign in to do that
Don't have an account?
lodoss118
Governor limits script statements?
what does the limit for script statements mean can anyone give me example how would end up in this limit seems abit funny as i have some very long code :) :) :)
Everything looks okay at first, until you realize the inner loop will never terminate until a governor kicks in. If there were no limits, then this code would merrily run along forever, freezing that data node, or until the script crashed entirely from an overflow, etc. The governor prevents this code from executing billions of times until there's a integer overflow (billions? higher?), which could slow execution for other users on that node, consuming excessive processing time. This is a simple example, but a more complex example might be a loop that could either reset itself or continue in a randomly indefinate pattern that's impossible for a compiler to predict.
The limits are actually quite reasonable, and with the new async Apex coming up, you'll be able to run larger code with relaxed governors...
And for those that didn't catch it in the example above, the inner loop runs indefinitely since i is never incremented inside the second loop, but the conditional depends on i. Only the governor keeps this code from running forever.