0

I have minions updating the same entity which gives concurrency problems, mostly on startup with errors like:

ERROR Message=SQL.UpdateEntity.Fail: Id='Entity-SellableItem-XXXX'|Try='1'|Environment='Entity-CommerceEnvironment-XXXXMinions'|Message='Concurrency error: The Entity version supplied (1220) is no longer the current version.

Therefore I'v tried to set the entities value for the minions in the environment as forexample this one:

{
  "$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
  "WakeupInterval": "01:00:00",
  "ListToWatch": "",
  "FullyQualifiedName": "Commerce.Engine.Feature.ProductImport.Minions.ImportProductsMinion, Commerce.Engine.Feature.ProductImport",
  "ItemsPerBatch": 10,
  "Entities": {
    "$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
    "$values": [
      "Sitecore.Commerce.Plugin.Catalog.SellableItem, Sitecore.Commerce.Plugin.Catalog"
    ]
  }
}

However I still get logs of concurrency errors on startup. My understanding is that minions check if any other minion with the same entity type is running, if one is found it will not run. Where am I going wrong?

1 Answer 1

1

The cause of this problem is there is a similar minion(default HabitatMinion) that is running against theprocessing the same list and updating the database at the same time.So with multiple minions trying to update the same list of commerce Entities, same entity is being edited by different minions at the same time resulting in this error.

To resolve this, First check in the logs to see if there is any other environment (such as HabitatMinion) is still running behind. If it is running, it will also pick up the lists from PlugIn.Minions.PolicySet-1.0.0.json.If Any trace of HabitatMinion is found, possibly find the habitat name in the policy config.json file and replace it with custom environment name. After performing the steps above bootstrap the environment and restart the application pool to get the changes from json files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.