persistentExamStudentRoom.lockWrite(examStudentRoom);
	public Boolean run(Integer executionCourseCode, Integer examCode, List roomsIds, boolean sms)		throws FenixServiceException {		Boolean result = new Boolean(false);		try {			ISuportePersistente sp = SuportePersistenteOJB.getInstance();			IPersistentExam persistentExam = sp.getIPersistentExam();			ISalaPersistente persistentRoom = sp.getISalaPersistente();			IFrequentaPersistente persistentAttends =				sp.getIFrequentaPersistente();			IPersistentExamStudentRoom persistentExamStudentRoom =				sp.getIPersistentExamStudentRoom();			IExam exam =				(IExam) persistentExam.readByOId(new Exam(examCode), true);			if (exam == null) {				throw new InvalidArgumentsServiceException("exam");			}			List students = exam.getStudentsEnrolled();			if (students == null) {				List executionCourses = exam.getAssociatedExecutionCourses();				Iterator iterCourse = executionCourses.iterator();				while (iterCourse.hasNext()) {					students.addAll(						persistentAttends.readByExecutionCourse(							(IDisciplinaExecucao) iterCourse.next()));				}			}			Iterator iterRoom = roomsIds.iterator();			List rooms = new ArrayList();			while (iterRoom.hasNext()) {				ISala room =					(ISala) persistentRoom.readByOId(						new Sala((Integer) iterRoom.next()),						true);				if (room == null) {					throw new InvalidArgumentsServiceException("room");				}				rooms.add(room);			}			if (!exam.getAssociatedRooms().containsAll(rooms)) {				throw new InvalidArgumentsServiceException("rooms");			}			Iterator iter = rooms.iterator();			while (iter.hasNext()) {				ISala room = (ISala) iter.next();				int i = 0;				while (i <= room.getCapacidadeExame().intValue()) {					IStudent student =						(IStudent) getRandomObjectFromList(students);					IExamStudentRoom examStudentRoom =						persistentExamStudentRoom.readBy(exam, student, room);					if (examStudentRoom == null) {						examStudentRoom =							new ExamStudentRoom(								exam,								(IStudent) getRandomObjectFromList(students),								room);					} else {						examStudentRoom.setRoom(room);					}					persistentExamStudentRoom.lockWrite(examStudentRoom);					if (sms) {						sendSMSToStudent(examStudentRoom);					}					i++;				}			}			if (students.size() > 0) {				throw new InvalidArgumentsServiceException("students");			}		} catch (ExcepcaoPersistencia e) {			throw new FenixServiceException(e);		}		return result;	}