on 10-05-2010 10:24 AM
"ServerException: Key mapping value must be unique. You cannot overwrite key mapping values."
I received such exception when code tried to manipulate Key Mappings of the record.
error was not happen on mdm 5.5 but on 7.1 it sometimes appears.
What is probable reason of this?
How to resolve this ?
Code is approximate so:
String[] keys = keyMapping.getKeys();
if (recordKeyMapping.containsKeyMapping(remoteSystem)) {
recordKeyMapping.replace(remoteSystem, keys);
}
else {
recordKeyMapping.addKeyMapping(keyMapping);
//Persist
targetRecord.update();
//where methods are:
public void replace(RemoteSystem remoteSystem, String[] keys) {
KeyMapping keyMapping = getKeyMapping(remoteSystem);
if (keyMapping == null) throw new IllegalArgumentException("Can't update keys: key mapping for the system '" + remoteSystem + "' is not found");
else {
keyMapping.setKeys(keys);
}
}
public void addKeyMapping(KeyMapping keyMapping) {
RemoteSystem remoteSystem = keyMapping.getRemoteSystem();
for(int i = 0; i < keyMapping.size(); i++) {
addKey(remoteSystem, (String) keyMapping.get(i));
}
}
Edited by: Vladimir Grigoryev on Oct 5, 2010 11:26 AM
Hi Vladimir,
The error occurs when there is already a record which has a key say "ABC", and the new record that you are creating is also trying to have the same remote key. Please check whay is mapped to remote key in import manager.
Thanks,
Priti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello -
I am not sure on that coding part. but is it like are you trying to retrive Key Mapping from Memory accelerator. Here this information always needs to be read from Database.
I am sure you also maintained the required attribute for key mapping as in Property in Console should be set as "Yes" and other relevant things properly .
Here also go through the below link for more insight from tools perspective.
http://help.sap.com/javadocs/mdm/sp06/com/sap/mdm/data/KeyMapping.html
It may help
Rgds
Deep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.