title: Two threads reading from the same table:how do i make both thread not to read the same set of data from the TASKS table
body: <p>I have a tasks thread running in two separate instances of tomcat.
  The Task threads concurrently reads (using select)  TASKS table on certain where condition and then does some processing.</p>
  
  <p>Issue is ,sometimes both the threads pick the same task , because of which the task is executed twice.
  My question is how do i make both thread not to read the same set of data from the TASKS table</p>