Developer forum

Forum » Development » Sql query to delete paragraph based item and the paragraph the item belongs to

Sql query to delete paragraph based item and the paragraph the item belongs to

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

I am trying to delete item type (ItemType_Frugtoggront) and the paragraph that it belongs to

The query below deletes the record fromt the ItemType table, and from the paragraph table


DELETE FROM ItemType_Frugtoggront  WHERE Id IN
(SELECT ParagraphItemId FROM Paragraph where ParagraphVersionTimeStamp > DATEADD(d, -30, GETDATE()) and ParagraphItemType='Frugtoggront')

DELETE FROM Paragraph where ParagraphVersionTimeStamp > DATEADD(d, -30, GETDATE()) and ParagraphItemType='Frugtoggront'

 

But i can still see the paragraph when i go to the page. What am i missing?

 

/Hans


Replies

 
Nicolai Pedersen
Reply

You need to reset the cache. You can do that in settings, developer, service cache, paragraph service and item service. Hit the refresh button

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Nicolai,

Can I jump into this thread? Where is the item service cache? I haven't seen that previously, and I checked on a 9.13.11 project and I still don't see it now. It's one of the caches that I've always wondered where it is. I typically see 70 service caches to choose from, but the only one with the word item in it is ProductAssignmentRuleMappingItem.

Thanks,

Scott

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

I think i can find it. That would be this one?

https://www.screencast.com/t/y2shUvs9s

Is there a way to trigger this as a part of a scheduled task?

/Hans

 
Nicolai Pedersen
Reply

@Hans yes.

@Scott - correct - no specific item service - it is handled by the page, area, grideow and paragraph services

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

@Nicolai, how can I trigger it as part of scheduled task?

/Hans

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You cannot.

But you can create another schedule that calls the clearcache maybe:

Votes for this answer: 1
 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

Ah ha. That makes sense to know that the item cache does live under the services that use the item type. 

Thanks,

Scott

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

ok, thank you Nicolai 👍

/Hans

 

You must be logged in to post in the forum