I’m using DynamoDB for users data, I have implemented everything by taking reference from mariodavid/jmix-petclinic-dynamodb project.
But having one problem, even if exception occurred changes are getting committed to table but I don’t want them to be committed. I’m handling exceptions at my own and displaying dialog or exception. Please help.
Below is my controller of User-edit.xml
@Install(target = Target.DATA_CONTEXT)
private Set commitDelegate(SaveContext saveContext) {
try {
User user = userService.updateUser(getEditedEntity());
getEditedEntity().setLastModifiedDate(user.getLastModifiedDate());
return Collections.singleton(backofficeUser);
} catch (EntityNotFoundException ex){
dialogs.createMessageDialog()
.withCaption("Alert")
.withMessage(ex.getMessage())
.withContentMode(ContentMode.HTML)
.show();
} catch(Exception ex) {
dialogs.createExceptionDialog()
.withCaption("Alert")
.withMessage(ex.getMessage())
.withThrowable(ex.fillInStackTrace())
.show();
}
return Collections.emptySet();
}