PlatformTransactionManager の globalRollbackOnParticipationFailure を false に設定すればよい(が、@Transactional が付いている単位で整合性のあるデータとしているともうので、このフラグをfalseにするということは、中途半端な状態でのコミットを許容するということに繋がる)
@Configuration
public class TransactionConfiguration {
@Autowired
private DataSource dataSource;
@Bean
public PlatformTransactionManager transactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource);
transactionManager.setGlobalRollbackOnParticipationFailure(false);
return transactionManager;
}
}