title: How do I prevent JPA inserts from locking a database table?
body: <p>I'm using Hibernate backed JPA as my persistence layer. I have a multi-threaded process that aggregates data from a Soap call and then stores a row in a database. The process usually ends up inserting about 700 rows and takes about 1 - 3 hours, with the Soap calls being the main bottleneck. </p>
  
  <p><strong>During this entire process the table I am inserting into locks up and will not return select statements in a timely manner.</strong> </p>
  
  <p>Here is the SQL server error:</p>
  
  <blockquote>
    <p>Error Message: Lock request time out period exceeded.</p>
  </blockquote>
  
  <p>How do I avoid locking my database table during this lengthy process?</p>