Monday, 13 August 2012

Error while updating user



Normally when we update a user ,we used to call findusers and then call a update

tcResultSet moResultSet = moUserUtility.findUsers(userMap);
hmUser.put("Users.User ID", UID);
hmUser.put("Users.Password", pwd);
moUserUtility.updateUser(moResultSet, hmUser);

now if you call a second update like

hmUser.put("Users.User ID", UID);
 hmUser.put("Users.First Name", FN);
moUserUtility.updateUser(moResultSet, hmUser);

it will throw exception like threw Exception Thor.API.Exceptions.tcStaleDataUpdateException which is caused because for the second update it did not call the find users.It should be like

tcResultSet moResultSet = moUserUtility.findUsers(userMap);
hmUser.put("Users.User ID", UID);
 hmUser.put("Users.First Name", FN);
moUserUtility.updateUser(moResultSet, hmUser);

Now the update works fine.


No comments:

Post a Comment