[JBoss JIRA] (GTNPORTAL-3014) OrganizationService.getUserHandler().findUsersByGroupId(groupid) not working with H2 database
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3014?page=com.atlassian.jira.pl... ]
RH Bugzilla Integration commented on GTNPORTAL-3014:
----------------------------------------------------
Honza Fnukal <hfnukal(a)redhat.com> changed the Status of [bug 915766|https://bugzilla.redhat.com/show_bug.cgi?id=915766] from VERIFIED to CLOSED
> OrganizationService.getUserHandler().findUsersByGroupId(groupid) not working with H2 database
> ---------------------------------------------------------------------------------------------
>
> Key: GTNPORTAL-3014
> URL: https://issues.jboss.org/browse/GTNPORTAL-3014
> Project: GateIn Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Identity integration
> Affects Versions: 3.6.0.Beta01
> Reporter: Marek Posolda
> Assignee: Marek Posolda
> Fix For: 3.6.0.Beta02
>
>
> Description of problem:
> Using default setup with H2 database, calling OrganizationService.getUserHandler().findUsersByGroupId(groupid) raises an exception.
> Executing the following code:
> 30 users = organizationService.getUserHandler().findUsersByGroupId("/platform/users");
> 31
> 32 if (users.getSize() > 0)
> 33 {
> results in the following exception:
> 11:01:30,352 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/127.0.0.1:8080-2) SQL Error: 90068, SQLState: 90068
> 11:01:30,352 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/127.0.0.1:8080-2) Order by expression "HIBERNATEI2_.NAME" must be in the result list in this case; SQL statement:
> select distinct hibernatei1_.ID as ID4_, hibernatei1_.IDENTITY_TYPE as IDENTITY2_4_, hibernatei1_.NAME as NAME4_, hibernatei1_.REALM as REALM4_ from jbid_io_rel hibernatei0_ inner join jbid_io hibernatei1_ on hibernatei0_.TO_IDENTITY=hibernatei1_.ID cross join jbid_io hibernatei2_ cross join jbid_io hibernatei3_ where hibernatei0_.TO_IDENTITY=hibernatei2_.ID and hibernatei0_.FROM_IDENTITY=hibernatei3_.ID and hibernatei2_.REALM=? and hibernatei3_.REALM=? and (hibernatei2_.NAME like ?) and hibernatei0_.FROM_IDENTITY=? order by hibernatei2_.NAME asc [90068-168]
> 11:01:30,355 ERROR [stderr] (http-/127.0.0.1:8080-2) org.picketlink.idm.api.query.QueryException: Failed to execute query
> 11:01:30,356 ERROR [stderr] (http-/127.0.0.1:8080-2) at org.picketlink.idm.impl.api.query.UserQueryExecutorImpl.execute(UserQueryExecutorImpl.java:220)
> 11:01:30,356 ERROR [stderr] (http-/127.0.0.1:8080-2) at org.picketlink.idm.impl.api.query.UserQueryExecutorImpl.list(UserQueryExecutorImpl.java:245)
> 11:01:30,356 ERROR [stderr] (http-/127.0.0.1:8080-2) at org.picketlink.idm.impl.api.session.IdentitySessionImpl.list(IdentitySessionImpl.java:364)
> 11:01:30,356 ERROR [stderr] (http-/127.0.0.1:8080-2) at org.exoplatform.services.organization.idm.IDMUserListAccess.getSize(IDMUserListAccess.java:123)
> 11:01:30,356 ERROR [stderr] (http-/127.0.0.1:8080-2) at org.exoplatform.demo.portlet.portletOrganization.doView(portletOrganization.java:32)
> The same issue does not show up with other databases, such as MySQL.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 1 month
[JBoss JIRA] (GTNPORTAL-3013) UserProfileDAOImpl not distinguishing creating and updating user profile when firing preSave/postSave events
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3013?page=com.atlassian.jira.pl... ]
RH Bugzilla Integration commented on GTNPORTAL-3013:
----------------------------------------------------
Honza Fnukal <hfnukal(a)redhat.com> changed the Status of [bug 947956|https://bugzilla.redhat.com/show_bug.cgi?id=947956] from VERIFIED to CLOSED
> UserProfileDAOImpl not distinguishing creating and updating user profile when firing preSave/postSave events
> ------------------------------------------------------------------------------------------------------------
>
> Key: GTNPORTAL-3013
> URL: https://issues.jboss.org/browse/GTNPORTAL-3013
> Project: GateIn Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Identity integration
> Affects Versions: 3.6.0.Beta01
> Reporter: Marek Posolda
> Assignee: Marek Posolda
> Fix For: 3.6.0.Beta02
>
>
> org.exoplatform.services.organization.idm.UserProfileDAOImpl; the following is a code excerpt of the file included in the community version of the Maven artefact org.exoplatform.portal:exo.portal.component.identity:3.3.0-GA
> // void createUserProfileEntry(UserProfile up, IdentitySession session) throws Exception
> // {
> // UserProfileData upd = new UserProfileData();
> // upd.setUserProfile(up);
> // session.save(upd);
> // session.flush();
> // cache_.remove(up.getUserName());
> // }
> public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
> {
> if (broadcast)
> {
> preSave(profile, true);
> }
> setProfile(profile.getUserName(), profile);
> if (broadcast)
> {
> postSave(profile, true);
> }
> }
> As you can see, the preSave() method is always called with "true". However, saveUserProfile() is the only available method for persisting UserProfile objects. From the commented-out createUserProfileEntry() method, I draw the conclusion that at some point, there was a distinction between methods to call for new and existing UserProfiles (just as there is for Users in the UserDAOImpl in the same package - there are a createUser() and a saveUser()).
> Where all this breaks down is in the listeners; upon saving the UserProfile, I want to send either a save or an update message over JMS to a SOA-P application that transforms the message and forwards it to a mainframe application that needs to know about user creation and modification. I need to pick the correct message format, but as it turns out, I can't use the isNew parameter to reliably determine which one to choose.
> I have tried to work around the problem by creating the UserProfile first and the User second, and sync from the User Listener, since the User preSave() does receive a correct value for isNew; however, Hibernate won't let me: new UserProfiles can not be saved if the User they are associated with does not yet exist in the database; they are a dependent entity.
> Can you provide a version of the Identity Component that can distinguish between updating and saving UserProfile objects, or a suitable workaround to that end?
> Version-Release number of selected component (if applicable):
> EPP 5
> JPP 6
> How reproducible:
> always
> Steps to Reproduce:
> please see attached customer case
>
> Actual results:
> true as the parameter even with update
> Expected results:
> true/false depending on create or update
> Additional info:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 1 month