Skip to content

Instantly share code, notes, and snippets.

@saqibmehmoodgit
Last active January 14, 2023 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqibmehmoodgit/27c24abf1c2582b7f5023c925d7d66c7 to your computer and use it in GitHub Desktop.
Save saqibmehmoodgit/27c24abf1c2582b7f5023c925d7d66c7 to your computer and use it in GitHub Desktop.
Employee service Course Service
@Autowired @Autowired
CourseService courseService; @Transactional(propagation=Propagation.REQUIRES_NEW)
@Autowired public void saveCourse()
EmplyeeRepository empRepo; {
@Transactional int a = 4;
public void saveEmplyee() a =a/0; /// devide by zer exception
}
{
Empylye emp = new Empylye();
////seters
empRepo.save(emp);
courseService.saveCourse();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment