teacher = persistentTeacher.readTeacherByNumber(teacherNumber);  Cloner.copyInfoExecutionCourse2ExecutionCourse(infoExecutionCourse); site = persistentSite.readByExecutionCourse(executionCourse); if(teacher == null ) throw new InvalidArgumentsServiceException(); List professorShipsExecutionCoursesList=teacher.getProfessorShipsExecutionCourses(); if(professorShipsExecutionCoursesList.contains(executionCourse)) throw new ExistingServiceException(); professorShipsExecutionCoursesList.add(executionCourse); teacher.setProfessorShipsExecutionCourses(professorShipsExecutionCoursesList);   persistentTeacher.lockWrite(teacher);
throw new ExistingServiceException(ex);
    public void run(InfoExecutionCourse infoExecutionCourse,Integer teacherNumber) throws FenixServiceException{		try{			ISuportePersistente sp = SuportePersistenteOJB.getInstance();			IPersistentTeacher persistentTeacher = sp.getIPersistentTeacher();			IPersistentSite persistentSite = sp.getIPersistentSite();			ITeacher teacher = null;            IDisciplinaExecucao executionCourse = null;			ISite site=null;						teacher = persistentTeacher.readTeacherByNumber(teacherNumber);								Cloner.copyInfoExecutionCourse2ExecutionCourse(infoExecutionCourse);			site = persistentSite.readByExecutionCourse(executionCourse);             if(teacher == null )                              throw new InvalidArgumentsServiceException();			List professorShipsExecutionCoursesList=teacher.getProfessorShipsExecutionCourses();			if(professorShipsExecutionCoursesList.contains(executionCourse))							throw new ExistingServiceException();			professorShipsExecutionCoursesList.add(executionCourse);			teacher.setProfessorShipsExecutionCourses(professorShipsExecutionCoursesList);									persistentTeacher.lockWrite(teacher);		}		catch(ExcepcaoPersistencia ex){			throw new ExistingServiceException(ex);		}    }