SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
SA: Cache not refreshing when altering procedure?

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
SA: Cache not refreshing when altering procedure?
Author Message
Mindflux



Joined: 25 May 2013
Posts: 746
Country: United States

Post SA: Cache not refreshing when altering procedure? Reply with quote
Okay, so I've got an SASE window up with exec dbo.FooBar

I hover over and click edit hyperlink, modify my procedure and hit F5 to make changes permanent

I close that editor window and come back to exec dbo.FooBar tab.

I hover over and click edit hyperlink again and see the procedure didn't save my changes.

I hit Ctrl+Shift+F8 (refresh cache) just in case.

Again back at exec dbo.FooBar and hover over and hit code link, code window appears with changes.

I then go do the edit hyperlink again, still has the stale code.

If I use Ctrl+W and find the procedure and select "edit procedure" the code is no longer stale.

So if this is a stale cache problem, why didn't Ctrl+Shift+F8 solve it?
Mon Jun 20, 2022 10:02 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 746
Country: United States

Post Reply with quote
https://www.screencast.com/t/cqBFZsIkmf

example
Mon Jun 20, 2022 10:11 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 746
Country: United States

Post Reply with quote

Mon Jun 20, 2022 10:17 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7576

Post Reply with quote
I think I can demystify some parts of what you observed and also confirm the deficiency impacting the procedural code view/edit, there is a still an old outstanding ticket for it, which is still not fixed. Each editor tab is fully independent. Technically that's not exactly the case, but for our purposes here, let's assume that's the case. By fully independent I mean each editor tab maintains its own database connection and the connection related cache. It also maintains its own instance of the Database Explorer populated from that connection. If you enable the Automatic Cache Refresh option, and execute DDL operations SQL Assistant usually can detect them,unless they're burred deep inside procedures, then the Database Explorer, contents of Intellisense popups, and some other cache related things refresh automatically. Here by DDL changes we mean CREATE / ALTER / DROP operations impacting contents of the Database Explorer and contents of Intellisense popups. Procedural code change don't fall into that group, and not refreshed automatically.

There is a known workaround. In the popup, click the Procedure name hyperlink in the top-left corner instead of the Edit hyperlink. This one retrieves procedure code and properties from the database each and every time you click it.
Mon Jun 20, 2022 1:15 pm View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 746
Country: United States

Post Reply with quote
SysOp wrote:
I think I can demystify some parts of what you observed and also confirm the deficiency impacting the procedural code view/edit, there is a still an old outstanding ticket for it, which is still not fixed. Each editor tab is fully independent. Technically that's not exactly the case, but for our purposes here, let's assume that's the case. By fully independent I mean each editor tab maintains its own database connection and the connection related cache. It also maintains its own instance of the Database Explorer populated from that connection. If you enable the Automatic Cache Refresh option, and execute DDL operations SQL Assistant usually can detect them,unless they're burred deep inside procedures, then the Database Explorer, contents of Intellisense popups, and some other cache related things refresh automatically. Here by DDL changes we mean CREATE / ALTER / DROP operations impacting contents of the Database Explorer and contents of Intellisense popups. Procedural code change don't fall into that group, and not refreshed automatically.

There is a known workaround. In the popup, click the Procedure name hyperlink in the top-left corner instead of the Edit hyperlink. This one retrieves procedure code and properties from the database each and every time you click it.



If each tab contains its own cache then why does the code hyperlink show the changed procedure?

Why does manually refreshing the cache not reflect the proper code afterwards ?
Mon Jun 20, 2022 1:34 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7576

Post Reply with quote
Unfortunately the code caching is a separate thing, not part of the main cache and that's why refreshing main cache doesn't help here. It's by design for supporting some other internal functions, but causing unwanted side effects like this one. They need to be fixed.
Mon Jun 20, 2022 4:20 pm View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 746
Country: United States

Post Reply with quote
Okay, thanks for clearing it up. Hope a fix comes eventually, I think itís bitten me in the butt a few times thinking I didnít commit my code.
Mon Jun 20, 2022 7:45 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.