title: How can we avoid Stored Procedures being executed in parallel?
body: <p>We have the following situation: </p>
  
  <p>A Stored Procedure is invoked by a middleware and is given a XML file as parameter. The Procedure then parses the XML file and inserts values into temporary tables inside a loop. After looping, the values inside the temporary tables are inserted into physical tables.</p>
  
  <p>Problem is, the Stored Procedure has a relatively long run-time (about 5 Minutes). In this period, it is likely that it is being invoked a second time, which would cause both processes to be suspended.</p>
  
  <p>Now my question:
  How can we avoid a second execution of a Stored Procedure if it is already running?</p>
  
  <p>Best regards</p>