Example usage for org.apache.ibatis.executor BatchExecutorException getSuccessfulBatchResults

List of usage examples for org.apache.ibatis.executor BatchExecutorException getSuccessfulBatchResults

Introduction

In this page you can find the example usage for org.apache.ibatis.executor BatchExecutorException getSuccessfulBatchResults.

Prototype

public List<BatchResult> getSuccessfulBatchResults() 

Source Link

Document

Returns a list of BatchResult objects.

Usage

From source file:com.ibatis.sqlmap.engine.execution.BatchException.java

License:Apache License

public BatchException(BatchExecutorException e) {
    this(e.getMessage(), e.getBatchUpdateException(), e.getSuccessfulBatchResults(), e.getFailingStatementId(),
            e.getFailingSqlStatement());
}

From source file:org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.java

License:Apache License

/**
 * An OptimisticLockingException check for batch processing
 *
 * @param operationsToFlush The list of DB operations in which the Exception occurred
 * @param cause the Exception object//  w w  w . j  a  v a2  s . co  m
 * @return The DbOperation where the OptimisticLockingException has occurred
 * or null if no OptimisticLockingException occurred
 */
private DbOperation hasOptimisticLockingException(List<DbOperation> operationsToFlush, Throwable cause) {

    BatchExecutorException batchExecutorException = ExceptionUtil.findBatchExecutorException(cause);

    if (batchExecutorException != null) {

        int failedOperationIndex = batchExecutorException.getSuccessfulBatchResults().size();
        if (failedOperationIndex < operationsToFlush.size()) {
            DbOperation failedOperation = operationsToFlush.get(failedOperationIndex);
            if (isOptimisticLockingException(failedOperation, cause)) {
                return failedOperation;
            }
        }
    }

    return null;
}