Java Code Examples for org.pentaho.di.trans.step.StepDataInterface#isDisposed()

The following examples show how to use org.pentaho.di.trans.step.StepDataInterface#isDisposed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DatabaseJoin.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Stop the running query
 * [PDI-17820] - In the Database Join step data.isCancelled is checked before synchronization and set after synchronization is completed.
 *
 * To cancel a prepared statement we need a valid database connection which we do not have if disposed has already been called
 *
 *
 * */
public synchronized void stopRunning( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
  if ( this.isStopped() || sdi.isDisposed() ) {
    return;
  }
  meta = (DatabaseJoinMeta) smi;
  data = (DatabaseJoinData) sdi;

  if ( data.db != null && data.db.getConnection() != null && !data.isCanceled ) {
    data.db.cancelStatement( data.pstmt );
    setStopped( true );
    data.isCanceled = true;
  }
}
 
Example 2
Source File: TableInput.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/** Stop the running query */
public synchronized void stopRunning( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
  if ( this.isStopped() || sdi.isDisposed() ) {
    return;
  }
  meta = (TableInputMeta) smi;
  data = (TableInputData) sdi;

  setStopped( true );

  if ( data.db != null && data.db.getConnection() != null && !data.isCanceled ) {
    data.db.cancelQuery();
    data.isCanceled = true;
  }
}