An example of the things that can go wrong is
- A domain contraint is violated
- An exception is thrown..caused by some weird thing or bad code
Recently where I work, we tried to explicitly throw an Exception in a service, like so
throw
new Exception()
But a rollback was not issued because the exception thrown wasn't a RuntimeException.
It is paramount that a RuntimeException is thrown if you desire a rollback in your services.