Environment
Hibernate 4.2
ojdbc6 - Oracle 11.2.0.3.0 JDBC 4.0
Oracle Database 11g
The issue
We foll
The oracle driver should return correct row counts. I will be surprised if this is not the case. Were you able to confirm that the results from the driver is correct? You can turn on Hibernate logging to check this.
Couple of things to check:
Log the actual SQL being sent to the DB and check to see that the version column is mentioned in the where clause. Not sure if the SQLs are logged by Hibernate logging with batching on, you might have to resort to a different way of logging the SQLs then (e.g., p6spy)
If the row counts are being returned correctly during concurrent updates, then the application is working fine. Confirm this by checking that the values of the version column is updated corrected.
Update According to the following link, this issue has been present with the Oracle driver until 11g and fixed in version 12c
https://hibernate.atlassian.net/browse/HHH-3360
For prior Oracle versions there is some additional information that should be useful, i.e., a custom solution is provided.
Additional resources: https://hibernate.atlassian.net/browse/HHH-5070