]
Trong Tran edited comment on GTNPORTAL-3365 at 6/20/14 3:46 AM:
----------------------------------------------------------------
thank [~thanhtt], I just updated on master following your comment at
[~ppalaga] Could you take care of the updating on 3.8.x ?
was (Author: trong.tran):
thank [~thanhtt], I just updated on master following your comment at
Exception swallow in UserDaoImpl.persistUserInfo()
--------------------------------------------------
Key: GTNPORTAL-3365
URL:
https://issues.jboss.org/browse/GTNPORTAL-3365
Project: GateIn Portal
Issue Type: Task
Security Level: Public(Everyone can see)
Affects Versions: 3.6.3.Final
Reporter: Vu Viet Phuong
Assignee: Vu Viet Phuong
Fix For: 3.8.2.Final, 3.9.0.Final
Original Estimate: 4 hours
Time Spent: 6 hours
Remaining Estimate: 0 minutes
Under "{{org.exoplatform.services.organization.idm}},
focus on :
{code:title=UserDAOImp.java|borderStyle=solid}
public void persistUserInfo(User user, IdentitySession session) throws Exception
{
orgService.flush();
AttributesManager am = session.getAttributesManager();
ArrayList attributes = new ArrayList();
/* ... */
if (user.getPassword() != null)
{
if (orgService.getConfiguration().isPasswordAsAttribute())
{
attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
}
else
{
try
{
am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()),
user.getPassword());
}
catch (IdentityException e)
{
log.info("Cannot update password: " + user.getUserName() +
"; ", e);
}
}
}
Attribute[] attrs = new Attribute[attributes.size()];
attrs = (Attribute[])attributes.toArray(attrs);
try
{
am.updateAttributes(user.getUserName(), attrs);
}
catch (IdentityException e)
{
log.info("Cannot update attributes for user: " + user.getUserName() +
"; ", e);
}
}
{code}
The method {{saveUser(User, boolean) _throws Exception_}}
calls
{{persistUserInfo(User user, IdentitySession session) _throws Exception_}}.
Whereas, deeper in the code, you can easily notice that exceptions are caught in this
level and traced by a {{log.info}}:
* first time in the password level
* second time when updating all of the attributes.
(!) Users want to be notified when an error occurs during user registration.
As well as being aware of the type of the caught exception.