SQL Cache Dependency - Again

Posts   
 
    
Posts: 1
Joined: 12-Mar-2009
# Posted on: 23-Mar-2009 16:58:31   

After reading every post in the forum, it seems i am still not sure how to properly implement the SQL Cache Dependency using llblgen with SelfServing.

I have a Business Layer that uses HttpRuntime.Cache so I am trying to figure out the best way to utilize llblgen to notify the cache of invalid chances when a entity is saved.

I guess in short, I would like someone who has done this or thought about this to recommend on exactly what they think is the best approach on achieving my goal.

basic scenario is, I cache a entity.. all works well, then data of this entity is changed which invalidates the cache, and I would like to some how notify the cache to re-get the entity. I guess this is where i am not sure what the best approach would be.

I am using sql server 2005 as the db.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 24-Mar-2009 09:40:14   

In SelfServicing, it's a little bit hard since there is no centralized location for this (to pick the command object) .

The extension point is the Dao class generated for each entity or the TypedListDAO for typedlists. There, override ExecuteMultiRowRetrievalQuery for entities, and ExecuteMultiRowDataTableRetrievalQuery for datatable/typedlist fetches.

With the override, you get the IQuery object which contains the IDataCommand object with the query syntaxis.

You then have to setup some kind of system to send back the grabbed command object so you can setup the dependency object as the Dao object at runtime isn't something you instantiate (except for typedlists, where you DO instantiate the Dao

ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=15192