Spring Configuration Exception rollback takes the Rollback-for= "Businessexception".
The difference between a check exception and a non-checked exception from Java.
Using spring will inevitably use spring's transaction management, and it is natural to use transaction management to choose Declarative transaction management, in the spring documentation, spring declarative transaction management defaults to non-checked exceptions and runtime exceptions for transaction rollback, A rollback operation is not performed on a check-type exception.
So what is a check-type exception and what is a non-check exception?
The simplest point of judgment is two:
1. A non-check exception that inherits from RuntimeException or error, and inherited from exception is a check-type exception (of course, runtimeexception itself is also a subclass of exception).
2. The non-check type exception can not be captured, and the check type exception must be handled with a try statement block or the exception to the superior method processing, in short, must write code to deal with it. So you have to catch the exception at the service and then throw it again, so the transaction just works.
--Quote http://cn-done.iteye.com/blog/775519
Also found MySQL database needs to set the table type to: InnoDB support transactions, otherwise the transaction will not be effective. ~!!
Spring Business Awareness