Updated product data from inRiver Connector

I am investigating an issue we are having regarding the data of a product variant when responding to an EventBroker message defined for the BaseProductUpdated event.

We need to check and perform a specific action on a Field defined in the inRiver data. We access the variant field data value as follows:

var valueWeWantToCheck = variant.Fields.GetValue(“the field we need to check”)

If the field is updated while running the application then the value we get is the old value and not that which is in the database. If I recycle the Application Pool then the new value appears. It seems to me that EntityFramework is not aware that the change has occurred and does not update the in-memory entity when a Get is performed.

Is there a way I can get this updated value into the application is a proper way?

Litium version: 5.6.5

It seems then cache is not getting updated, maybe you need to add a eventListener to fire on Field updates.

I’m not sure that will solve my problem.

Even if I do not pay attention to the MessageBus and I update, for example, the product description after the field value has been updated, in the website I get the updated description but not the updated field value.

Why are you listening to the BaseProductUpdated event. It is possible that the BaseProduct is updated first and the variant is updated later. It is better to listen to VariantUpdated event.

We subscribe to BaseProductUpdated and VariantUpdated amongst others.

Perhaps I was mistaken to mention the MessageBus as the problem does not seem to have anything to with the MessageBus and the messages to which I have subscribed. I’ve only noticed the problem because I expected to have the updated value after accessing the value in one of these events we have subscribed to.

If a variant field value is updated, when accessing this value in the code I still have the old value and not the new value which I can see when querying the database directly (using SQL Server Management Studio). How can I force the EF Context to be updated with the correct value without restarting the application? (recycling the application pool)

So is the issue that within an update-event the entity passed into the event is what it looked like before the update?

I’ve checked the entity you describe and the value here is correct. We actually were not using the entity as it was provided in the eventArgs of the EventBroker subscription and accessing the Variant again in a handler for the event subscription. Clearly what we have been doing in this handler is incorrect.

Thanks for thinking with me :slight_smile:

Great! Set this issue to resolved if you are satisfied :slight_smile: