Muddassir Rahman
Muddassir Rahman

Reputation: 946

Catch exception inside spring transaction and commit without rollback

Is it possible to catch exception inside spring transaction and commit without rollback?

Upvotes: 1

Views: 279

Answers (1)

Essex Boy
Essex Boy

Reputation: 7940

You can specify exceptions to be ignored, in other words the commit will happen.

Example

@Transactional(noRollbackFor = SomeException.class)

Doc is here

Or you can just catch the exception, will have the same effect.

Upvotes: 1

Related Questions