Class OracleBatchCollector

  • All Implemented Interfaces:
    BatchCollector

    public class OracleBatchCollector
    extends DefaultBatchCollector
    According to the Oracle documentation the result is not returned for batch updates see http://docs.oracle.com/cd/B19306_01/java.102/b14355/oraperf.htm#i1057545 "For a prepared statement batch, it is not possible to know the number of rows affected in the database by each individual statement in the batch. Therefore, all array elements have a value of -2." Using an Oracle batch there is a total returned but no result for individual statements.

    This class implements a hybrid solution. Statements with optimistic locking are executed in the preprocess phase using native oracle.jdbc.OraclePreparedStatements. All other statements are executed regularly by delegating to DefaultBatchCollector.

    • Constructor Detail

      • OracleBatchCollector

        public OracleBatchCollector​(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                                    int batchSize,
                                    boolean optimisticLockEnabled)
    • Method Detail

      • preProcess

        protected java.util.Map<java.lang.String,​BatchGroup> preProcess​(java.util.Map<java.lang.String,​BatchGroup> batchGroups)
        Description copied from class: DefaultBatchCollector
        Allows to do any pre-process phase before batch groups will be processed. Default implementation does not pre-process batch groups.
        Overrides:
        preProcess in class DefaultBatchCollector