Attaching actions to rollbacks in Spring

We have a problem in a Spring Boot app where some files are created during a database transaction and they need to be deleted if the transaction rolls back. This was my solution... When a file is created, we publish an event containing the filename: We have another component which listens for the event: As … Continue reading Attaching actions to rollbacks in Spring

@Transactional gotchas

Here are some surprising things I've learned about Spring Data JPA lately. 1) When a @Transactional method calls another @Transactional method, an uncaught RuntimeException in the second method rolls back the entire transaction Method A is annotated with @Transactional. It calls Method B (in a different class) several times. Method B is also annotated with … Continue reading @Transactional gotchas