* the user was not identified.
* @throws ServiceException if a database error occured
*/
@Override
public String recoverUserPassword(String email, String phone) {
User user = null;
try {
begin();
user = getUserDAO().getUserWithEmailAndPhone(email, phone, getConnection());
commit();
} catch (DAOException e) {
throw new ServiceException("Error in retrieving user with email and password", e);
} catch (SQLException e) {
throw new ServiceException("Error in retrieving user with email and password", e);
} finally {
closeConnection();
}
if (user == null)
return null;
user.setLastLoginDate(null);
user.setSessionID(this.randUtil.getRandSessionID());
updateUser(user, " for password recovery: sessionID, last login Date");
return user.getSessionID();
}