[JBoss JIRA] (GTNPORTAL-3539) Do not recover IDM transaction if exception occurs during a search.
by Trong Tran (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3539?page=com.atlassian.jira.pl... ]
Trong Tran commented on GTNPORTAL-3539:
---------------------------------------
I find that this happens when we pass username with NULL value to UserHandler#findUserByName() method. It indirectly executes org.picketlink.idm.api.PersistenceManager.findUser(String) as below:
{code}
try {
foundUser = session.getPersistenceManager().findUser(userName);
} catch (Exception e) {
handleException("Cannot obtain user: " + userName + "; ", e);
}
{code}
The #findUser() method throws an exception, then the rollback of IDM transaction will be indirectly executed inside the #handleException method (by calling #recoverFromIDMError one). That's why it reverts the new user was created before.
This not only impacts to UserHandler#findUserByName() BUT also for every place that is using PersistenceManager#findUser() --> so the *workaround* is to remove the #handleException in the try-catch block.
============
However, what really concerns me is about the org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl.flush() which is called almost everywhere before PersistenceManager#findUser() done. It looks like the pending changes should be saved at this time, when the transaction rollback should not be a problem. Is there any IDM expert who can confirm this ?
> Do not recover IDM transaction if exception occurs during a search.
> -------------------------------------------------------------------
>
> Key: GTNPORTAL-3539
> URL: https://issues.jboss.org/browse/GTNPORTAL-3539
> Project: GateIn Portal
> Issue Type: Task
> Affects Versions: 3.7.0.Final
> Reporter: Tran Trung Thanh
> Priority: Minor
> Fix For: 3.9.0.Final
>
>
> If user meets an exception during a search, it is not neccessary to recover transaction.
> Unit test
> {code:java}
> @Test
> public void testFailDuringSearch() throws Exception {
> String USER = "test";
> createUser(USER);
> userHandler_.findUserByName(null);
> User user = userHandler_.findUserByName(USER);
> assertTrue("Found user instance ", user != null);
> userHandler_.removeUser(USER, true);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 7 months
[JBoss JIRA] (GTNPORTAL-3530) User with special UTF-8 character in display name appears not correctly in GateIn using MS SQL Server 2008
by Trong Tran (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3530?page=com.atlassian.jira.pl... ]
Trong Tran updated GTNPORTAL-3530:
----------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> User with special UTF-8 character in display name appears not correctly in GateIn using MS SQL Server 2008
> ----------------------------------------------------------------------------------------------------------
>
> Key: GTNPORTAL-3530
> URL: https://issues.jboss.org/browse/GTNPORTAL-3530
> Project: GateIn Portal
> Issue Type: Bug
> Reporter: Tuyen Nguyen The
> Assignee: Tuyen Nguyen The
> Fix For: 3.9.0.Final
>
> Attachments: displayname_nok.png, displayname_ok.png
>
>
> Steps to reproduce:
> - start GateIn using MS SQL Server 2008, instead of HSQL.
> - login as root
> - Click on display name to open user profile dialog
> - Change user info with first name is "Nguyễn", last name is "Thế Tuyến", and display name is "Nguyễn Thế Tuyến"
> - Click save and now "Nguyễn Thế Tuyến" is appeared correctly in display name field on the top-right (See [^displayname_ok.png])
> - Restart Gatein and login with root again
> Problem: Display name appears not correctly. (see [^displayname_nok.png])
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 7 months