1

I am updating customer in different minions.

Sometime two minions are running at same time and are failing to persist data with below error.

ERROR SQL.UpdateEntities.Fail: Ids='Entity-Customer-ed10c86ac67841d490185ef5723dec29'|Environment='Entity-CommerceEnvironment-ENBDMinions'|Message='Concurrency error: The Entity version supplied (2019) is no longer the current version.'

Is there a way to abort one minion if other minion is running?

3

It also depends on what Sitecore Commerce version you are using. You can follow the below doc from the Sitecore site - https://doc.sitecore.com/developers/93/sitecore-experience-commerce/en/commerce-engine-minions.html

It says -

The MinionPolicy includes an Entities parameter that specifies the entity types that the minion processes.

Before a minion runs, it checks to see if any other minions that are running are configured to process the same entity types as it processes. If another such minion is processing the same entity types, the minion waits until that first minion has finished running before starting its own process. This prevents concurrency errors that arise if two minions attempt to update the same entity at the same time.

For example, before the FullIndexMinion runs, it checks to make sure that neither the DeleteIndexDocumentsMinion nor the IncrementalIndexMinion (both of which work with the same entity types) are running at the same time, to avoid corrupted data in the indexes.

The following shows an example of an indexing minion policy:

​{
    ​"$type": "Sitecore.Commerce.Core.MinionPolicy, Sitecore.Commerce.Core",
    ​"WakeupInterval": "00:05:00",
    ​"ListsToWatch": [
      ​"CatalogItemsIndex"
    ​],
    ​"FullyQualifiedName": "Sitecore.Commerce.Plugin.Search.IncrementalIndexMinion, Sitecore.Commerce.Plugin.Search",
    ​"ItemsPerBatch": 1000,
    ​"SleepBetweenBatches": 500,
    ​"Entities": {
      ​"$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
       ​"$values": [
         ​"Sitecore.Commerce.Plugin.Catalog.Catalogs, Sitecore.Commerce.Plugin.Catalog",
         ​"Sitecore.Commerce.Plugin.Catalog.Category, Sitecore.Commerce.Plugin.Catalog",
         ​"Sitecore.Commerce.Plugin.Catalog.SellableItem, Sitecore.Commerce.Plugin.Catalog"
        ​]
      ​}
    ​},

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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