Custom Oracle Batcher to allow batch updates for versioned data (Hibernate 4.x)

Description

This is a refactoring of for use with Hibernate 4.x
I am aware that was rejected, but since it was not rejected for technical reasons, but rather because the Hibernate team felt it did not belong to Hibernate core, I am posting this code hoping that the team re-considers this time around. And if the team does not re-consider, at least it will be useful for fellow Hibernate users running on Oracle.

Attachments

7

Activity

Show:

Christian Beikov April 5, 2024 at 1:48 PM

I suppose this was just a bug in the driver and it works now.

Jürg Wanner November 4, 2016 at 7:59 AM

Is there a version of this that works with hibernate 5? Can I just apply the differences between version 4 and 5 hibernate BatchingBatch class to OracleBatchingBatch class?
Has anybody already done that?

Manuel Dominguez Sarmiento May 27, 2014 at 5:57 PM

Updated C3P0OracleBatchingBatch fixes incorrect exception handling.

Manuel Dominguez Sarmiento April 19, 2014 at 2:02 AM

hibernate.jdbc.batch.builder needs to be specified in hibernate.properties in order to take advantage of these classes.

Manuel Dominguez Sarmiento April 19, 2014 at 2:01 AM

I have attached the latest 12.1 Oracle JDBC driver documentation, which suggests that this solution is no longer necessary. However, this is only true when executing against a 12c DB instance.

If we are executing against an 11gR2 or previous DB instance version, even if using the 12.1 driver, executeBatch() returns -2 (Statement.SUCCESS_NO_INFO) and thus batch updates with versioned data will not work correctly with stock Hibernate (meaning that optimistic locking will silently fail causing lost updates), requiring the solution proposed in this issue.

Out of Date

Details

Assignee

Reporter

Components

Priority

Created April 19, 2014 at 1:43 AM
Updated April 5, 2024 at 1:48 PM
Resolved April 5, 2024 at 1:48 PM