Reputation: 26904
By default, Spring's Transactional
annoation won't rollback on checked exceptions.
One can use Transactional
's rollbackFor
attribute to override this.
Is it possible to override this behaviour globally rather than on each annotation?
I have methods that throw IOException. A possibility could be wrapping those exceptions in RuntimeException
, as they are unrecoverable for my code.
Upvotes: 0
Views: 538
Reputation: 299068
There are two approaches that I am aware of:
Upvotes: 3