public boolean isUniqueLoginNameConstraint() {
IProfileDAO dao = Registry.getProfileDAO();
if (isNewObject()) {
return !dao.existsByProfileNameAnotherTransaction(profileName);
} else {
try {
Profile p = dao.findByProfileNameAnotherTransaction(profileName);
return p.getId().equals(getId());
} catch (InstanceNotFoundException e) {