What it does ChainedTransactionManageris basically start and commit transactions in the reverse order. Therefore, if you have JpaTransactionManagerand RabbitTransactionManagerand configured so.
@Bean
public PlatformTransactionManager transactionManager() {
return new ChainedTransactionManager(rabbitTransactionManager(), jpaTransactionManager());
}
Now, if the JPA transaction is successful, but your commit to rabbitMQ fails, your changes to the database will still be saved as they are already committed.
To answer your first question, he will not give you a real atomic transaction, everything that was committed before the appearance Exception(upon completion) will remain faithful.
. http://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/transaction/ChainedTransactionManager.html