class SynchronizeAfterMerge extends BaseTransform<SynchronizeAfterMergeMeta, SynchronizeAfterMergeData> implements ITransform<SynchronizeAfterMergeMeta, SynchronizeAfterMergeData> {

  public boolean init() {
    if ( super.init() ) {
      try {
        meta.normalizeAllocationFields();
        data.realSchemaName = environmentSubstitute( meta.getSchemaName() );
        if ( meta.istablenameInField() ) {
          if ( Utils.isEmpty( meta.gettablenameField() ) ) {
            logError( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Log.Error.TableFieldnameEmpty" ) );
            return false;
          }
        }

        data.databaseMeta = meta.getDatabaseMeta();

        // if we are using Oracle then set releaseSavepoint to false
        //TODO: change when we remove those variants of IDatabase
        if ( data.databaseMeta.getIDatabase().isOracleVariant() ) {
          data.releaseSavepoint = false;
        }

        data.commitSize = Integer.parseInt( environmentSubstitute( meta.getCommitSize() ) );
        data.batchMode = data.commitSize > 0 && meta.useBatchUpdate();

        // Batch updates are not supported on PostgreSQL (and look-a-likes) together with error handling (PDI-366)
        //
        data.specialErrorHandling =
          getTransformMeta().isDoingErrorHandling() && meta.getDatabaseMeta().supportsErrorHandlingOnBatchUpdates();

        data.supportsSavepoints = meta.getDatabaseMeta().getIDatabase().useSafePoints();

        if ( data.batchMode && data.specialErrorHandling ) {
          data.batchMode = false;
          if ( log.isBasic() ) {
            logBasic( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Log.BatchModeDisabled" ) );
          }
        }

        if ( meta.getDatabaseMeta() == null ) {
          logError( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Init.ConnectionMissing", getTransformName() ) );
          return false;
        }
        data.db = new Database( this, meta.getDatabaseMeta() );
        data.db.shareVariablesWith( this );
        data.db.connect( getPartitionId() );
        data.db.setCommit( data.commitSize );

        return true;
      } catch ( HopException ke ) {
        logError( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Log.ErrorOccurredDuringTransformInitialize" ) + ke
          .getMessage() );
      }
    }
    return false;
  }

  public  SynchronizeAfterMerge( TransformMeta transformMeta, SynchronizeAfterMergeMeta meta, SynchronizeAfterMergeData data, int copyNr, PipelineMeta pipelineMeta,
                                Pipeline pipeline );

}