Search in sources :

Example 1 with DBCExecutionPurpose

use of org.jkiss.dbeaver.model.exec.DBCExecutionPurpose in project dbeaver by serge-rider.

the class ResultSetJobDataRead method run.

@Override
protected IStatus run(DBRProgressMonitor monitor) {
    error = null;
    final ProgressLoaderVisualizer<Object> visualizer = new ProgressLoaderVisualizer<>(this, progressControl);
    progressMonitor = visualizer.overwriteMonitor(monitor);
    DBCExecutionPurpose purpose = DBCExecutionPurpose.USER;
    if (dataFilter != null && dataFilter.hasFilters()) {
        purpose = DBCExecutionPurpose.USER_FILTERED;
    }
    new PumpVisualizer(visualizer).schedule(PROGRESS_VISUALIZE_PERIOD * 2);
    try (DBCSession session = getExecutionContext().openSession(progressMonitor, purpose, NLS.bind(CoreMessages.controls_rs_pump_job_context_name, dataContainer.toString()))) {
        statistics = dataContainer.readData(this, session, controller.getDataReceiver(), dataFilter, offset, maxRows, DBSDataContainer.FLAG_READ_PSEUDO);
    } catch (DBException e) {
        error = e;
    } finally {
        visualizer.completeLoading(null);
    }
    return Status.OK_STATUS;
}
Also used : DBException(org.jkiss.dbeaver.DBException) ProgressLoaderVisualizer(org.jkiss.dbeaver.ui.controls.ProgressLoaderVisualizer) DBCExecutionPurpose(org.jkiss.dbeaver.model.exec.DBCExecutionPurpose) DBCSession(org.jkiss.dbeaver.model.exec.DBCSession)

Aggregations

DBException (org.jkiss.dbeaver.DBException)1 DBCExecutionPurpose (org.jkiss.dbeaver.model.exec.DBCExecutionPurpose)1 DBCSession (org.jkiss.dbeaver.model.exec.DBCSession)1 ProgressLoaderVisualizer (org.jkiss.dbeaver.ui.controls.ProgressLoaderVisualizer)1