on 04-12-2006 8:50 AM
Hi,
we have a portalservice, which is creating users with the following code:
IUserAccountFactory userAccountFactory = UMFactory.getUserAccountFactory();
userAccount = userAccountFactory.newUserAccount(logonId, uniqueUserId);
When we try to create users with unique names with a length which does not satisfy the required minimum length of user-id (customizable in the UM configuration), the above code raises an UMException with message LOGONID_TOO_SHORT. Everything fine up this point.
What is amazing now: After changing the minimum length we tried to create this user (lets say 'xyz') again, but we get the message "user with unique name 'xyz' already exits". Whereas searching for user 'xyz' returns "user not found"!
Is this a bug? Or is there a possibility to unlock these "zombies"?
Thanks and regards
Jan
Hi Jan,
Once an exceptions occurs,you must delete the user and then try to create a new user.
User can be deleted by:
IUserfactory userfact = UMFactory.getUserFactory();
IUser user = userFact.getUserByLoginID(userid);
string uniqueid= user.getUniqueID();
userfact.deleteUser(uniquedid);
And make sure you are issuing commit() inorder to actually create the user.
Regards,
Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saravanan,
deleting the user does not work, because userFact.getUserByLoginID(userid) does not return a user (UMException, unknow logon-id).
As I said this user is somehow a "zombie", searching for it returns "user not known", whereas trying to create it returns "user already exists"...
Any ideas?
Thanks and regards
jan
Ok, the problem was: I first created the User and based on that User I tried to create the UserAccount. Creating the User was fine, but creating the account failed (due to a logon-id which was too short).
A User without an account can not be found inside the portal, it is only an internal instance of the UME, but without an account it does not have an external representation. But it still exists and therefore can not be created again.
So I solved the problem by deleting the user like this:
IUserFactory userFactoryEP6 = UMFactory.getUserFactory();
IUser userEP6 = userFactoryEP6.getUserByUniqueName(uniqueName);
String uid = userEP6.getUniqueID();
userFactoryEP6.deleteUser(uid);
I also rewrote my Exception-handling in the createUser-coding: If creation an account fails, I delete the user I created right before. This ensures, that no "zombie"-users are left behind.
regards
Jan
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.