I have 2 repositories, one for mongodb (DocumentRepository) and the other for hibernate entity (EntityRepository)
I have a simple service:
@Transactional
public doSomePersisting() {
try {
this.entityRepository.save(entity);
this.documentRepository.save(document);
}
catch(...) {
//Rollback mongoDB here
}
}
Is it possible to rollback the mongoDB on the "//Rollback mongoDB here" line? I already got a rollback from the entity part (Transactional annotation)
See Question&Answers more detail:os