use of com.cubrid.common.ui.cubrid.table.dialog.imp.event.ImportDataFailedEvent in project cubrid-manager by CUBRID.
the class AbsImportRunnable method commit.
/**
*
* Commit the data
*
*
* @param monitor IProgressMonitor
* @param currentRow int
* @throws SQLException The exception
*/
protected void commit(List<ImportRowData> rowList) throws SQLException {
if (pStmt == null) {
return;
}
try {
pStmt.executeBatch();
QueryUtil.commit(conn);
handleEvent(new ImportDataSuccessEvent(tableName, rowList.size()));
LOGGER.debug("Committed : " + rowList.size());
} catch (SQLException ex) {
QueryUtil.rollback(conn);
ImportDataFailedEvent failedEvt = new ImportDataFailedEvent(tableName, rowList.size(), "", ex.getMessage());
handleEvent(failedEvt);
LOGGER.debug("Failed : " + rowList.size());
writeErrorLog(rowList);
} finally {
rowList.clear();
try {
pStmt.clearBatch();
} catch (SQLException e) {
LOGGER.error(e.getMessage());
processSQLException(e);
}
}
}
Aggregations