Added no roll back example

This commit is contained in:
Amitabh Tiwari 2021-01-05 20:17:31 +05:30
parent 1b4e5782ec
commit 3bf9bf4094
1 changed files with 6 additions and 0 deletions

View File

@ -35,4 +35,10 @@ public class CourseService {
}
}
@Transactional(noRollbackFor = { SQLException.class })
public void createCourseDeclarativeWithNoRollBack(Course course) throws SQLException {
courseDao.create(course);
throw new SQLException("Throwing exception for demoing Rollback!!!");
}
}