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 ; }
An OptimisticLockingException check for batch processing