We have such situation:
Our entities:
ExtUser
UserSkill
Liferay entities:
Address,
Contact,
Phone
We want to update ZplUser which is a facade containing all those entities. For update we are using ZplUserLocalServiceImpl class.
this class contains such method
1
2public ZplUser updateZplUser(long companyId, ZplUser zplUser) throws SystemException, PortalException{
3 phoneLocalService.update(zplUser.getMobilePhone());
4 addressLocalService.update(zplUser.getAddress());
5 extUserLocalService.update(zplUser.getExtUser());
6 userSkillLocalService.addUserSkill(100,100);
7 userSkillLocalService.setUserSkills(zplUser.getUser().getUserId(), zplUser.getSkillIds());
8 return zplUser;
9}
in method setUserSkills(...) we hardcoded throwing a SystemException to test if all operations that are before setUserSkills would be rolled back.
Unfortunatelly only one operation is rolled back - addUserSkill(100,100). All other operations ARE NOT ROLLED BACK.
What we are doing wrong? What to do to achieve rollbacking of all five operations?