title: Testing Optimistic Locking in Java EE environment
body: <p>As I understand if a row in a database table is updated simultaneously by multiple threads the database would flag an error.</p>
  
  <p>In our production environment we have 2 Tomcat servers in a cluster. It might happen that the two users are directed to each one of the Tomcat servers at the same time and they update the same record in the database table. As a result, an exception would be thrown.</p>
  
  <p>How do I simulate this situation on my local machine? Or how would I do it some environment which is same as production?</p>
  
  <p>Technology that I am working on: Java 6, Spring 3, Hibernate, MS SQL Server 2008 and Tomcat 7.</p>