title: MySQL LOCK TABLES Alternatives (used in stored procedure)
body: <p>Does somebody know a way to LOCK tables while a stored procedure is being executed?</p>
  
  <p>My procedure is a simple aggregation process which loads data into other table. when it's done, it should update all selected rows as <code>aggregated</code> on the original table. </p>
  
  <p>it seems essential to me to lock the original table during the procedure so i can avoid a situation in which  during the process new rows will be inserted the first table, but at the end of the process they still will be count as <code>aggregated</code> (as this update part applies for the whole table).</p>
  
  <p>Any suggestions? Thanks!</p>