can any body provide some insight here..
I have been having hard time, while getting through spring @Transactional(Propagation Nested)
I have been searching all over net and here, but unable to find any generic example of specific type regarding this..
@Transactional(required)
mtdOne(User userObj1, User userObj2)
{
someBean.mtdtwo( userObj1);
someBean.mtdThree(userObj2);
}
@transactional(nested)
mtdTwo(userObj1)
{
//calling dao and insert data into DATABASE
daoObj.save(userObj1);
//this data must not be rolled back,
// even though exception thrown in next method
}
@transactional(required)
mtdThree(userObj2)
{
//calling dao second time and insert data into DATABASE
daoObj.save(userObj2);
/////Some Exception thrown here
}
So i want to save methodTwo data into DB, and must not be rolled back even though exception thrown in next method..
I want to achieve this Using Transaction(Nested)
Please give me any suggestions..