Response validateScopeResponse = validateScope(request, Collections.singletonList(AbstractResource.SCOPE_WRITE));
if (validateScopeResponse != null) {
return validateScopeResponse;
}
ResourceOwner persistedResourceOwner = getResourceOwner(request, id);
if (persistedResourceOwner == null) {
return Response.status(Response.Status.NOT_FOUND).build();
}
LOG.debug("About to update existing resourceOwner {} with new properties: {}", persistedResourceOwner,
resourceOwner);
ResourceOwner savedInstance;
try {
//we run transactional modus, so any constraint violations only occur after the commit of the transaction (to late...)
validate(resourceOwner);
savedInstance = resourceOwnerRepository.save(resourceOwner);
} catch (Exception e) {