Skip to content

Commit 3e89517

Browse files
committed
make last save be in its on transaction so it can never be rolled back
1 parent 63ff658 commit 3e89517

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/main/java/it/aboutbits/springboot/emailservice/lib/application

src/main/java/it/aboutbits/springboot/emailservice/lib/application/ManageEmail.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Email completeClaimedSend(Email email) {
139139
);
140140
}
141141
}
142-
return emailRepository.save(email);
142+
return transactionTemplate.execute(_ -> emailRepository.save(email));
143143
}
144144

145145
void cleanupAttachments(final Email email) throws AttachmentException {

0 commit comments

Comments
 (0)