title: Hibernate Row Locking on read
body: <p>I have a table <code>Jobs</code> with fields <code>Name</code> and <code>Status</code>.</p>
  
  <p>I'm trying to deploy two separate applications in a tomcat instance to poll the jobs table for new records but it's important that the same job record is not received by both processes. How can I do this?</p>
  
  <p>My (unsuccessful) approach thus far has been to use spring integration:</p>
  
  <pre><code>&lt;int-jdbc:inbound-channel-adapter 
      query="select * from jobs where status=1"
      channel="rawInputDataListChannel"
      data-source="dataSource"
      update="update input_table set status=2 where status=1"&gt;
      &lt;int:poller fixed-rate="1"&gt;
          &lt;int:transactional isolation="READ_COMMITTED" /&gt;
      &lt;/int:poller&gt;
  &lt;/int-jdbc:inbound-channel-adapter&gt;
  </code></pre>
  
  <p>Since this didn't work I thought that maybe having the transaction manager in tomcat so it could be shared by both applications might work but I'm struggling to get that up and running. Would this approach work?</p>