title: hibernate executeUpdate wrong number of affected rows
body: <p>I'm working with Hibernate 4.1.7, and a MySQL driver. I have a very simple table, <em>table1</em>, that has 2 columns, <em>id</em> and <em>label</em>.
  In this table, there are 2 lines. </p>
  
  <p>My problem is: When I update the labels for all the lines, it first tells me "2 rows affected". Great. When I update the same lines with the same values, it also tells me "2 rows affected". Wrong, it should tell me "0 rows affected", as I already updated the data.</p>
  
  <p>Here is the code for this:</p>
  
  <pre><code>public static void Integer doUpdate(){
      final Query query = hbmSesssion.createSQLQuery("UPDATE table1 SET label = 'toto'");
      final Integer result = query.executeUpdate();
      hbmSession.getTransaction().commit();
  }
  </code></pre>
  
  <p>In my main:</p>
  
  <pre><code>System.out.println("nb updates: " + doUpdate());
  //gives "nb updates: 2", that's OK
  //then, I check in the Database, the update is ok, all the lines have 'toto' values
  System.out.println("nb updates: " + doUpdate());
  //gives "nb updates: 2", that's wrong!
  </code></pre>
  
  <p>Am I missing something essential in the docs? I have the same problem with plain JDBC statements, so I suspect a misuse of the Java/MySQL driver. Of course, if I send the same 2 queries in PhpMyAdmin, it first tells me "2 lines updated", and then "0 lines updated".</p>