Hi
Have a transaction in a grails Service class on which a rollback flag is set:
TransactionAspectSupport
.currentTransactionInfo()
.transactionStatus
.setRollbackOnly()
what happens is that when we return to the Controller an exception:
org.springframework.transaction.UnexpectedRollbackException
which we have to catch in the Controller (but not in any of the Service classes). This code is being refactored from the previous solution where all the logic happened direct in the Controller. Any advise on what happens that trips this exception to be thrown when the method returns, given that:
static transactional = true
has been set on all the classes. Guessing theres some subtle Controller verses Service magic happening - does anyone know about this? For now just catching the exception as a workaround, but this loses the TransactionStatus object that otherwise would have been returned.
Any thoughts much appreciated