Thursday 9 June 2016

Spring @Transactional does not role back when exception occurs

I think you are dealing with custom exception like

public class CustomException extends Exception {

//Your code
}

But Spring @Transactional only deal with runtime exceptions. So you need to chnage in your code like 

public class CustomException extends RuntimeException {

//Your code
}