private String logFailedRowChangeSQL(StringBuffer stmt,OneRowChange oneRowChange){
  try {
    ArrayList<OneRowChange.ColumnSpec> keys=oneRowChange.getKeySpec();
    ArrayList<OneRowChange.ColumnSpec> columns=oneRowChange.getColumnSpec();
    ArrayList<ArrayList<OneRowChange.ColumnVal>> keyValues=oneRowChange.getKeyValues();
    ArrayList<ArrayList<OneRowChange.ColumnVal>> columnValues=oneRowChange.getColumnValues();
    String log="Failing statement : " + stmt.toString() + "\nArguments:";
    for (int row=0; row < columnValues.size() || row < keyValues.size(); row++) {
      log+="\n - ROW# = " + row;
      for (int c=0; c < columns.size(); c++) {
        if (columnValues.size() > 0) {
          OneRowChange.ColumnSpec colSpec=columns.get(c);
          ArrayList<OneRowChange.ColumnVal> values=columnValues.get(row);
          OneRowChange.ColumnVal value=values.get(c);
          log+="\n" + THLManagerCtrl.formatColumn(colSpec,value,"COL",null,false,true,null);
        }
      }
      for (int k=0; k < keys.size(); k++) {
        if (keyValues.size() > 0) {
          OneRowChange.ColumnSpec colSpec=keys.get(k);
          ArrayList<OneRowChange.ColumnVal> values=keyValues.get(row);
          OneRowChange.ColumnVal value=values.get(k);
          log+="\n" + THLManagerCtrl.formatColumn(colSpec,value,"KEY",null,false,true,null);
        }
      }
    }
    if (log.length() > maxSQLLogLength)     log=log.substring(0,maxSQLLogLength);
    return log;
  }
 catch (  Exception e) {
    if (logger.isDebugEnabled())     logger.debug("logFailedRowChangeSQL failed to log, because: " + e.getMessage());
  }
  return null;
}

private String logFailedRowChangeSQL ( StringBuffer stmt , OneRowChange oneRowChange ) { try { ArrayList < OneRowChange . ColumnSpec > keys = oneRowChange . getKeySpec ( ) ; ArrayList < OneRowChange . ColumnSpec > columns = oneRowChange . getColumnSpec ( ) ; ArrayList < ArrayList < OneRowChange . ColumnVal > > keyValues = oneRowChange . getKeyValues ( ) ; ArrayList < ArrayList < OneRowChange . ColumnVal > > columnValues = oneRowChange . getColumnValues ( ) ; String log = "Failing statement : " + stmt . toString ( ) + "\nArguments:" ; for ( int row = 0 ; row < columnValues . size ( ) || row < keyValues . size ( ) ; row ++ ) { log += "\n - ROW# = " + row ; for ( int c = 0 ; c < columns . size ( ) ; c ++ ) { if ( columnValues . size ( ) > 0 ) { OneRowChange . ColumnSpec colSpec = columns . get ( c ) ; ArrayList < OneRowChange . ColumnVal > values = columnValues . get ( row ) ; OneRowChange . ColumnVal value = values . get ( c ) ; log += "\n" + THLManagerCtrl . formatColumn ( colSpec , value , "COL" , null , false , true , null ) ; } } for ( int k = 0 ; k < keys . size ( ) ; k ++ ) { if ( keyValues . size ( ) > 0 ) { OneRowChange . ColumnSpec colSpec = keys . get ( k ) ; ArrayList < OneRowChange . ColumnVal > values = keyValues . get ( row ) ; OneRowChange . ColumnVal value = values . get ( k ) ; log += "\n" + THLManagerCtrl . formatColumn ( colSpec , value , "KEY" , null , false , true , null ) ; } } } if ( log . length ( ) > maxSQLLogLength ) log = log . substring ( 0 , maxSQLLogLength ) ; return log ; } catch ( Exception e ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "logFailedRowChangeSQL failed to log, because: " + e . getMessage ( ) ) ; } return null ; }
logs prepared statement and it ' s arguments into error log stream . trims the message if it exceeds maxsqlloglength .
