Transaction in spring boot
Did you try to use google for this? You have multiple way to do this :P

For example: @Transactional annotation on method.

Or using XML file to wrap methods with transaction.

Just look for this on google: https://spring.io/guides/gs/managing-transactions/