Developer forum

Forum » Integration » Update product information using SQL Add-in

Update product information using SQL Add-in

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a situation where I need to update some values on the master product, based on some values of the Variants.

I have created a Scheduled task using the SQL add-in and I have added my SQL statement.

The Scheduled task runs correctly and the values in the database are updated.

However, even if the updated value is visible on the Product list in the back-end, if I open the product details page, the value is not updated in the interface.
And if I try to output the value in a template in front-end, I don't get the updated value.

Is this a known issue? Is there any solution for it?

I am running on DW 9.9.7.

Thank you,
Adrian


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Adrian,

 

Did you try to clear the cache from the Product Service? Since you are not using the EcomProvider that would have to be done separately.

 

Best Regards,

Nuno Aguiar

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nuno,
This is a scheduled task that is supposed to run without my intervention.

My expectation was that the Scheduled Add-in will take care of all the cache clearing after running the job.

Otherwise, it is pointless to use it if the information is not visible.

Adrian

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Adrian,

 

Well, there are a lot of things that DW caches granularly, so the Scheduled Task Add-in needs to know what to clear the cache for. Simply clearing "all" is too agressive.

 

That said, I don't know what schedule task add-in your using (standard or custom), if it's tied to a Data integration job that has a specific Provier OR straight up SQL. If it's basic SQL, there is no trigger that looks at DB tables (SQL) to figure our which objects (API) are using them, to them determine which caches to clear.

 

Does that help or clarify?

Nuno

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nuno,

Thank you for the detailed information.

I am using the standard SQL Add-in.

I understand the challenges of clearing the cache and it makes sense. Since it is that generic, it cannot clear everything.

Is there another way of using a SQL statement and a job? I have never tried the Data integration option with SQL Provider.

Thank you,
Adrian

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Adrian,

 

  • Using the DataIntegration SQL Provider would not help you either because you don't have the list of services to pick which to clear cache for
  • The Scheduled Task SQL Add-in also does not give you that control

 

I do have 1 recommendation. Since Scheduled tasks can be sorted, you can create another scheduled task that runs after the one with the SQL Add-in, but have this one trigger a Method. That way you can develop a dll that has your ClearCacheIfMySqlAddInUpdatedData() method. You'd in C# fnd out the services you want to clear, but that should be relatively simple.

It's not ideal, I give you that, but it's a solution.

 

(sorry for the long delay replying)

Nuno Aguiar

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nuno,

Thank you for the suggestion. It actually sounds like the only option :)

It would be good if DW can give us some built-in way of handling these cases, although I agree that it could lead to a lot of headaches if it would be configured improperly.

Thank you,

Adrian

 

You must be logged in to post in the forum