提交 534fa629 编写于 作者: S Serge Rider

Code cleanup

上级 fe867ebe
......@@ -299,11 +299,14 @@ class ResultSetDataPumpJob extends DataSourceJob implements DBCExecutionSource {
@Override
protected IStatus runInUIThread(DBRProgressMonitor monitor) {
// TODO: to something
/*
if (!finished) {
error = new DBException("Query cancellation timeout. Query processing was terminated in UI.");
finished = true;
finishProgress();
}
*/
return Status.OK_STATUS;
}
}
......
......@@ -145,7 +145,7 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
StringBuilder query = new StringBuilder(100);
query.append("SELECT ");
appendSelectSource(session.getProgressMonitor(), query, tableAlias, rowIdAttribute);
appendSelectSource(monitor, query, tableAlias, rowIdAttribute);
query.append(" FROM ").append(getFullQualifiedName());
if (tableAlias != null) {
query.append(" ").append(tableAlias); //$NON-NLS-1$
......@@ -166,6 +166,9 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
firstRow,
maxRows))
{
if (monitor.isCanceled()) {
return statistics;
}
if (dbStat instanceof JDBCStatement && maxRows > 0) {
boolean useFetchSize = getDataSource().getContainer().getPreferenceStore().getBoolean(ModelPreferences.RESULT_SET_USE_FETCH_SIZE);
if (useFetchSize) {
......@@ -183,7 +186,7 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
statistics.setExecuteTime(System.currentTimeMillis() - startTime);
if (executeResult) {
DBCResultSet dbResult = dbStat.openResultSet();
if (dbResult != null) {
if (dbResult != null && !monitor.isCanceled()) {
try {
if (rowIdAttribute != null) {
String attrId = rowIdAttribute.getAlias();
......
......@@ -43,7 +43,7 @@ public abstract class AbstractJob extends Job
// Attached job may be used to "overwrite" current job.
// It happens if some other AbstractJob runs in sync mode
protected final static ThreadLocal<AbstractJob> CURRENT_JOB = new ThreadLocal<AbstractJob>();
protected final static ThreadLocal<AbstractJob> CURRENT_JOB = new ThreadLocal<>();
protected AbstractJob(String name)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册