@Override
public void rollback(IParam param) {
if(rollback.isEmpty()){
logger.error(writerID + ": Fail to roll back because rollback sql is empty!");
throw new WormholeException("Fail to roll back because rollback sql is empty!",JobStatus.ROLL_BACK_FAILED.getStatus()+errorCodeAdd,writerID);
}
try{
conn = DBSource.getConnection(GreenplumWriter.class, ip, writerID, dbname);
String[] sqlArray = rollback.split(";");
for(String sql:sqlArray){
sql = sql.trim();
if(sql.isEmpty()) {
continue;
}
DBUtils.update(conn, sql);
}
conn.close();
} catch (Exception e) {
logger.error(writerID + ": Greenplum writer roll back failed. ");
throw new WormholeException(e,JobStatus.ROLL_BACK_FAILED.getStatus()+errorCodeAdd,writerID);
}
}