Forum Discussion
3 Replies
- OS_PizzaContributor III
This is probably when you have an existing dictonary key value pair and you are attempting to assign a new key value pair with the same name. You have to explain the entire process and the business rule.
- RossLikesOSNew Contributor
Adding a little more non-technical answer to the question posed.
We kept seeing the recurring error "An item with the same key has been added." in our logs and it seemed to be randomly occurring on calculated members in our UD1 dimension. Several of our UD1 members had api.data.calculate formulas assigned that reference multiple Account.Base ranges. Turns out that a couple of the account ranges assigned had duplicate base members in their respective ranges. We had to make sure that if we were pulling account ranges in member formulas, you need to make sure they are all referencing unique base members.
- ChristianWValued Contributor
The name of your business rule implies, that it runs in parallel. If the dictionary is used in parallel as well (by using globals?), you will run in problems, because the standard dictionary doesn’t support parallel processing.
For parallel processing, you have to us the ConcurrentDictionary (an import System.Collections.Concurrent line is needed).ConcurrentDictionary has a TryAdd and TryUpdate method to avoid problems from running in parallel.
I hope this helps, for a better understanding of your problem and a more concrete help, we need to know more about the business rule.
Related Content
- 3 years ago
- 2 years ago