让我们说我有这样的方法:
@Override
@Transactional(rollbackFor = ImportException.class, noRollbackFor = MultipleImportException.class, isolation = Isolation.READ_COMMITTED)
public ProcessImport doImport(File file) throws ImportException, RetryLaterException {
try (InputStream in = new FileInputStream(file)) {
return doImport(file, in);
} catch (IOException e) {
throw new ImportException(e);
}
}
ImportException
正在扩展Exception
并且还有更多功能,MultipleImportException
正在扩展ImportException
。所以我的问题:是否没有可能将子类用于noRollBack-Policy?