title: why select for update works properly only with versioned entity?
body: <p>I use HSQLDB 2.4.1 with Spring data-jpa.
  I see that another thread is able to update the same row if field '@Version' is absent.
  2 threads running by Spring '@Scheduled' updating records with special status meaning it hasn't been processed yet.</p>
  
  <p>Reading method in Repository:</p>
  
  <pre><code>@Lock(LockModeType.PESSIMISTIC_READ)
  @Query("select t from Task t where t.state = 0")
  Page&lt;Task&gt; findUnprocessed(Pageable p);
  </code></pre>
  
  <p>'process1' and 'process2' do almost the same simple update but 'process1' has longer pause before saving.</p>
  
  <pre><code>@Scheduled(fixedDelay = 10)
  @Transactional(Transactional.TxType.REQUIRED)
  public void process1() throws Exception {
      try {
          Task task = getTasks();
          System.out.println("process1: " + task + " by " + Thread.currentThread().getName());
          task.data= task.data + " by 1";
          task.state = 1;
          Thread.sleep(random.nextInt(4_000));
          repo.save(task);
          System.out.println("process1 updated: " + task.id);
          System.out.println("process1 read same = " + repo.findById(task.id));
      } catch (EmptyResultDataAccessException e) {
          //do nothing
      }
  }
  </code></pre>
  
  <p>Log of processing:</p>
  
  <pre><code>process1: Task(id=1) by thr-1
  process2: Task(id=1) by thr-2
  process2 updated: 1
  process2 read same = Task(id=1, data= by 2) &lt;&lt;!!!
  process2: Task(id=2, data=) by thr-2
  process2 updated: 2
  process2 read same = Task(id=2, data= by 2)
  process1 updated: 1
  process1 read same = Task(id=1, data= by 1) &lt;&lt;!!!
  </code></pre>
  
  <p>As a result Task#1 is updated by 'process1' after it has been already updated by process2. Why if 'lock for update' has been used?
  Everything works ok with '@Version' field (process2 got exception then).</p>