Open brokenbrains opened 3 years ago
Hi dev,
Any idea why onFailure on Command Return throw org.springframework.transaction.UnexpectedRollbackException?
public Message debit(CommandMessage<DebitCommand> cm) { try { accountService.debit(cm.getCommand().getAccountId(), cm.getCommand().getAmount()); return withSuccess(); } catch (InsufficientFundsException e) { logger.info("InsufficientFundsException catch"); return withFailure(new InsufficientFundsReply()); } }
it throw when return withFailure. withSuccess was no problems
here the log tram jdbc error rollback.txt
Hi it's this? code invoked by message handlers shouldn't use Spring's @Transactional since that interferes with Eventuate Tram's transaction management. The stack trace suggests that @Transactional is being used.
Sorry for the delayed response.
Yes, what you are seeing is consistent with having used @Transactional
Hi dev,
Any idea why onFailure on Command Return throw org.springframework.transaction.UnexpectedRollbackException?
public Message debit(CommandMessage<DebitCommand> cm) { try { accountService.debit(cm.getCommand().getAccountId(), cm.getCommand().getAmount()); return withSuccess(); } catch (InsufficientFundsException e) { logger.info("InsufficientFundsException catch"); return withFailure(new InsufficientFundsReply()); } }
it throw when return withFailure. withSuccess was no problems
here the log tram jdbc error rollback.txt