title: how to check if hibernate update has completed?
body: <p>I have a for loop that calls another method which saves the data to a temporary table using hibernate. After the for loop, I have a code that calls a stored procedure to copy the data that was saved from the temporary table to the live table. However, the stored procedure is being called first before hibernate starts saving the data even if the code for saving the data is before the stored procedure. So when I query the live table, the data were not there. Is there a way to wait for hibernate to complete updating before i call the stored procedure? Hibernate seems to wait for the for loop to finish first before it updates the database which is probably why when i call the stored procedure the result was empty. Can anyone help on how i can address this delay? thanks a lot.</p>
  
  <p>here is my code:</p>
  
  <pre><code>for(Object1 obj: obj1List){
  saveHibernateObj(obj);
  }
  
  getCurrentSession().createSQLQuery("Call update_object()").executeUpdate();
  </code></pre>