Class BatchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.ibatis.sqlmap.engine.execution.BatchException
- 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. This exception is only thrown from the executeBatchDetailed
method.- Author:
- Jeff Butler
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBatchException
(String message, BatchUpdateException cause, List successfulBatchResults, String failingStatementId, String failingSqlStatement) Instantiates a new batch exception. -
Method Summary
Modifier and TypeMethodDescriptionReturns the BatchUpdateException that caused the nested batch to fail.Returns the SQL statement that caused the failure (not the parameters).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
-
Constructor Details
-
BatchException
public BatchException(String message, BatchUpdateException cause, List successfulBatchResults, String failingStatementId, String failingSqlStatement) Instantiates a new batch exception.- Parameters:
message
- the messagecause
- the causesuccessfulBatchResults
- the successful batch resultsfailingStatementId
- the failing statement idfailingSqlStatement
- the failing sql statement
-
-
Method Details
-
getBatchUpdateException
Returns the BatchUpdateException that caused the nested batch to fail. That exception contains an array of row counts that can be used to determine exactly which statemtn of the batch 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-batch executed before the failing batch.- Returns:
- the previously successful batch results (may be an empty list if no batch has executed successfully)
-
getFailingSqlStatement
Returns the SQL statement that caused the failure (not the parameters).- Returns:
- the failing SQL string
-
getFailingStatementId
Returns the statement id of the statement that caused the failure.- Returns:
- the statement id
-