Package org.apache.ibatis.executor
Class BatchExecutorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.ibatis.exceptions.IbatisException
org.apache.ibatis.exceptions.PersistenceException
org.apache.ibatis.executor.ExecutorException
org.apache.ibatis.executor.BatchExecutorException
- All Implemented Interfaces:
Serializable
This exception is thrown if a
java.sql.BatchUpdateException
is caught
during the execution of any nested batch. The exception contains the
java.sql.BatchUpdateException that is the root cause, as well as
the results from any prior nested batch that executed successfully.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BatchResult
private final BatchUpdateException
private static final long
private final List
<BatchResult> -
Constructor Summary
ConstructorsConstructorDescriptionBatchExecutorException
(String message, BatchUpdateException cause, List<BatchResult> successfulBatchResults, BatchResult batchResult) -
Method Summary
Modifier and TypeMethodDescriptionReturns the BatchUpdateException that caused the nested executor to fail.Returns the SQL statement that caused the failure (not the parameterArray).Returns the statement id of the statement that caused the failure.Returns a list of BatchResult objects.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
successfulBatchResults
-
batchUpdateException
-
batchResult
-
-
Constructor Details
-
BatchExecutorException
public BatchExecutorException(String message, BatchUpdateException cause, List<BatchResult> successfulBatchResults, BatchResult batchResult)
-
-
Method Details
-
getBatchUpdateException
Returns the BatchUpdateException that caused the nested executor to fail. That exception contains an array of row counts that can be used to determine exactly which statement of the executor caused the failure (or failures).- Returns:
- the root BatchUpdateException
-
getSuccessfulBatchResults
Returns a list of BatchResult objects. There will be one entry in the list for each successful sub-executor executed before the failing executor.- Returns:
- the previously successful executor results (may be an empty list if no executor has executed successfully)
-
getFailingSqlStatement
Returns the SQL statement that caused the failure (not the parameterArray).- Returns:
- the failing SQL string
-
getFailingStatementId
Returns the statement id of the statement that caused the failure.- Returns:
- the statement id
-