public static KettleDatabaseBatchException createKettleDatabaseBatchException( String message, SQLException ex ) { KettleDatabaseBatchException kdbe = new KettleDatabaseBatchException( message, ex ); if ( ex instanceof BatchUpdateException ) { kdbe.setUpdateCounts( ( (BatchUpdateException) ex ).getUpdateCounts() ); } else { // Null update count forces rollback of batch kdbe.setUpdateCounts( null ); } List<Exception> exceptions = new ArrayList<Exception>(); SQLException nextException = ex.getNextException(); SQLException oldException = null; // This construction is specifically done for some JDBC drivers, these // drivers // always return the same exception on getNextException() (and thus go // into an infinite loop). // So it's not "equals" but != (comments from Sven Boden). while ( ( nextException != null ) && ( oldException != nextException ) ) { exceptions.add( nextException ); oldException = nextException; nextException = nextException.getNextException(); } kdbe.setExceptionsList( exceptions ); return kdbe; }
processBatchException( be.toString(), be.getUpdateCounts(), be.getExceptionsList() ); } catch ( KettleException e ) { logError( "Unexpected error processing batch error", e );
processBatchException( be.toString(), be.getUpdateCounts(), be.getExceptionsList() ); } catch ( KettleException e ) { logError( "Unexpected error processing batch error", e );
errorMessage = be.toString(); batchProblem = true; sendToErrorRow = true; updateCounts = be.getUpdateCounts(); exceptionsList = be.getExceptionsList(); msg.append( Const.CR ); msg.append( "Errors encountered (first 10):" ).append( Const.CR ); for ( int x = 0; x < be.getExceptionsList().size() && x < 10; x++ ) { Exception exception = be.getExceptionsList().get( x ); if ( exception.getMessage() != null ) { msg.append( exception.getMessage() ).append( Const.CR );
errorMessage = be.toString(); batchProblem = true; sendToErrorRow = true; updateCounts = be.getUpdateCounts(); exceptionsList = be.getExceptionsList(); msg.append( Const.CR ); msg.append( "Errors encountered (first 10):" ).append( Const.CR ); for ( int x = 0; x < be.getExceptionsList().size() && x < 10; x++ ) { Exception exception = be.getExceptionsList().get( x ); if ( exception.getMessage() != null ) { msg.append( exception.getMessage() ).append( Const.CR );