try { ISuportePersistente sp = SuportePersistenteOJB.getInstance(); sala = new Sala(infoSala.getNome(), infoSala.getEdificio(), infoSala.getPiso(), infoSala .getTipo(), infoSala.getCapacidadeNormal(), infoSala.getCapacidadeExame()); try { sp.getISalaPersistente().simpleLockWrite(sala); result = true; } catch (ExistingPersistentException ex) { throw new ExistingRoomServiceException(ex); } } catch (ExcepcaoPersistencia ex) { throw new FenixServiceException(ex.getMessage());
final ISala room = Cloner.copyInfoRoom2Room(infoSala);  final ISalaPersistente roomDAO = sp.getISalaPersistente(); final ISala existingRoom = roomDAO.readByName(infoSala.getNome());  if (existingRoom != null) { throw new ExistingServiceException("Duplicate Entry: " + infoSala.getNome());
    public Object run(InfoRoom infoSala) throws FenixServiceException {        ISala sala = null;        boolean result = false;        try {            ISuportePersistente sp = SuportePersistenteOJB.getInstance();            sala = new Sala(infoSala.getNome(), infoSala.getEdificio(), infoSala.getPiso(), infoSala                    .getTipo(), infoSala.getCapacidadeNormal(), infoSala.getCapacidadeExame());            try {                sp.getISalaPersistente().simpleLockWrite(sala);                result = true;            } catch (ExistingPersistentException ex) {                throw new ExistingRoomServiceException(ex);            }        } catch (ExcepcaoPersistencia ex) {            throw new FenixServiceException(ex.getMessage());        }        return new Boolean(result);    }