Class BatchDbSqlSession

    • Constructor Detail

      • BatchDbSqlSession

        public BatchDbSqlSession​(DbSqlSessionFactory dbSqlSessionFactory,
                                 java.sql.Connection connection,
                                 java.lang.String catalog,
                                 java.lang.String schema)
    • Method Detail

      • postProcessBatchSuccess

        protected FlushResult postProcessBatchSuccess​(java.util.List<DbOperation> operations,
                                                      java.util.List<org.apache.ibatis.executor.BatchResult> batchResults)
      • postProcessBatchFailure

        protected FlushResult postProcessBatchFailure​(java.util.List<DbOperation> operations,
                                                      java.lang.RuntimeException exception)
      • postProcessJdbcBatchResult

        protected void postProcessJdbcBatchResult​(java.util.Iterator<DbOperation> operationsIt,
                                                  int[] statementResults,
                                                  java.lang.Exception failure,
                                                  java.util.List<DbOperation> failedOperations)

        This method can be called with three cases:

        • Case 1: Success. statementResults contains the number of affected rows for all operations.
        • Case 2: Failure. statementResults contains the number of affected rows for all successful operations that were executed before the failed operation.
        • Case 3: Failure. statementResults contains the number of affected rows for all operations of the batch, i.e. further statements were executed after the first failed statement.

        See BatchUpdateException.getUpdateCounts() for the specification of cases 2 and 3.

      • requiresAffectedRows

        protected boolean requiresAffectedRows​(DbOperationType operationType)
      • postProcessOperationPerformed

        protected void postProcessOperationPerformed​(DbOperation operation,
                                                     int rowsAffected,
                                                     java.lang.Exception failure)
      • executeSelectForUpdate

        protected void executeSelectForUpdate​(java.lang.String statement,
                                              java.lang.Object parameter)
        Specified by:
        executeSelectForUpdate in class DbSqlSession