public synchronized void delClusterSchema( ObjectId id_cluster ) throws KettleException { // First, see if the schema is still used by other objects... // If so, generate an error!! // // We look in table R_TRANS_CLUSTER to see if there are any transformations using this schema. String[] transList = repository.getTransformationsUsingCluster( id_cluster ); if ( transList.length == 0 ) { repository.connectionDelegate.performDelete( "DELETE FROM " + quoteTable( KettleDatabaseRepository.TABLE_R_CLUSTER ) + " WHERE " + quote( KettleDatabaseRepository.FIELD_CLUSTER_ID_CLUSTER ) + " = ? ", id_cluster ); } else { StringBuilder message = new StringBuilder(); message.append( "The cluster schema is used by the following transformations:" ).append( Const.CR ); for ( int i = 0; i < transList.length; i++ ) { message.append( " " ).append( transList[i] ).append( Const.CR ); } message.append( Const.CR ); KettleDependencyException e = new KettleDependencyException( message.toString() ); throw new KettleDependencyException( "This cluster schema is still in use by one or more transformations (" + transList.length + ") :", e ); } }
KettleDependencyException e = new KettleDependencyException( message.toString() ); throw new KettleDependencyException( "This partition schema is still in use by one or more transformations (" + transList.length + ") :", e );
KettleDependencyException e = new KettleDependencyException( message.toString() ); throw new KettleDependencyException( "This slave server is still in use by one or more transformations (" + transList.length + ") or cluster schemas (" + clustList.length + ") :", e );
public synchronized void delDatabase( ObjectId id_database ) throws KettleException { repository.getSecurityProvider().validateAction( RepositoryOperation.DELETE_DATABASE ); // First, see if the database connection is still used by other connections... // If so, generate an error!! // We look in table R_STEP_DATABASE to see if there are any steps using this database. // String[] transList = repository.getTransformationsUsingDatabase( id_database ); String[] jobList = repository.getJobsUsingDatabase( id_database ); if ( jobList.length == 0 && transList.length == 0 ) { repository.connectionDelegate.performDelete( "DELETE FROM " + quoteTable( KettleDatabaseRepository.TABLE_R_DATABASE ) + " WHERE " + quote( KettleDatabaseRepository.FIELD_DATABASE_ID_DATABASE ) + " = ? ", id_database ); } else { String message = " Database used by the following " + Const.CR; if ( jobList.length > 0 ) { message = "jobs :" + Const.CR; for ( String job : jobList ) { message += "\t " + job + Const.CR; } } message += "transformations:" + Const.CR; for ( String trans : transList ) { message += "\t " + trans + Const.CR; } KettleDependencyException e = new KettleDependencyException( message ); throw new KettleDependencyException( "This database is still in use by " + jobList.length + " jobs and " + transList.length + " transformations references", e ); } }