Revert "[Bug #1006] it catchs HibernateOptimisticLockingFailureException in validator method"

This reverts commit d3be77ff43.
This commit is contained in:
Manuel Rego Casasnovas 2011-05-11 09:52:31 +02:00
parent d3be77ff43
commit 41c357a3c3
3 changed files with 2 additions and 8 deletions

View file

@ -90,6 +90,7 @@ public class CalendarExceptionTypeDAO extends
}
@Override
@Transactional(readOnly = true)
public CalendarExceptionType findByName(String name) throws InstanceNotFoundException {
if (StringUtils.isBlank(name)) {
throw new InstanceNotFoundException(null, CalendarExceptionType.class.getName());

View file

@ -28,7 +28,6 @@ import java.util.EnumMap;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.hibernate.NonUniqueResultException;
import org.hibernate.validator.AssertTrue;
import org.hibernate.validator.NotNull;
import org.navalplanner.business.calendars.daos.ICalendarExceptionTypeDAO;
@ -37,7 +36,6 @@ import org.navalplanner.business.common.Registry;
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
import org.navalplanner.business.workingday.EffortDuration;
import org.navalplanner.business.workingday.EffortDuration.Granularity;
import org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException;
/**
* Type of an exception day.
@ -173,12 +171,7 @@ public class CalendarExceptionType extends IntegrationEntity {
return calendarExceptionType.getId().equals(getId());
} catch (InstanceNotFoundException e) {
return true;
} catch (NonUniqueResultException e) {
return false;
} catch (HibernateOptimisticLockingFailureException e) {
return true;
}
}
}

View file

@ -48,7 +48,7 @@ import org.zkoss.util.InvalidValueException;
*/
@Service
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@OnConcurrentModification(goToPage = "/excetiondays/exceptionDays.zul")
@OnConcurrentModification(goToPage = "/exceptionDays/exceptionDays.zul")
public class CalendarExceptionTypeModel extends IntegrationEntityModel
implements ICalendarExceptionTypeModel {