Interface BatchedResultChecker

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Incubating @FunctionalInterface public interface BatchedResultChecker

Checks the result for one row in a JDBC batch.

The checker gives higher-level mutation code a row-specific hook for handling optimistic-lock and stale-state outcomes after JDBC batch execution. It is associated with a row when that row is added to a SingleStatementBatch.

Implementations return true when the observed outcome is acceptable and false when the batch should keep treating the row as a stale-state failure. A thrown SQLException is converted by the owning batch.

Since:
8.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkResult(int affectedRowCount, int batchPosition, String sqlString, SessionFactoryImplementor sessionFactory)
    Check the result for one row of a JDBC batch.
  • Method Details

    • checkResult

      boolean checkResult(int affectedRowCount, int batchPosition, String sqlString, SessionFactoryImplementor sessionFactory) throws SQLException
      Check the result for one row of a JDBC batch.
      Parameters:
      affectedRowCount - the row count reported for this batch entry
      batchPosition - zero-based position of the row within the executed JDBC batch
      sqlString - SQL string for the batch statement
      sessionFactory - the session factory associated with execution
      Returns:
      true if the result is acceptable, false to keep treating it as a stale-state failure
      Throws:
      SQLException - if result checking needs to report a JDBC failure