Custom workflow concurrency / synchronization issue - unique value creation
Hi, I have custom workflow which is used to generate a unique identifier. The unique identifier is generated by some rules and then FIM DB is checked through EnumerateResourcesActivity if this value is already taken. This works just fine when only a single request is triggering the workflow. When multiple requests in a short timeframe trigger that workflow, it can happen that duplicate values are generated, because at the time the EnumerateResourcesActivity is executed, none of the running workflows has persisted its unique value to the FIM DB, yet. So the query for the unique value returns no hits and the workflow continues to persist the (almost) unique value. I tried to work around this issue by isolating the query and update activities inside a SynchronizationScopeActivity. But this doesn't work as expected. Did anyone have a similar problem? Or is there another strategy to solve the problem of unique value creation? Btw: the unique value in that case is an email address.
January 28th, 2012 8:44am

You could use a SQL table with a unique key on the column as an intermediate test.My Book - Active Directory, 4th Edition My Blog - www.briandesmond.com
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2012 8:36pm

I see the condition you are checking for, but if the unique value is something like a number that increments with each new account, you would hit some duplicates fairly frequently, but if its based on a firstname/lastname with a number to break a tie, you would have to think how likely that two of the same name would be created within the time it takes for a new person to get into FIM. If you want to make sure that the situation is handled, even if its unlikely, use Brian's suggestion of a database table that won't have concurrency issues.Frank C. Drewes III - Senior Consultant: Oxford Computer Group
January 29th, 2012 2:19am

Yes, I see, I was looking for a more lightweight solution. But when it comes to distributed setups having a central instance which enforces uniqueness seems to be the only option.
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2012 2:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics