Caching Issues

Posts   
 
    
sparky12
User
Posts: 2
Joined: 29-Dec-2008
# Posted on: 29-Dec-2008 12:19:02   

Hi Guys,

We’re using v2.6 and have Adapter as a template group to generate a code. Our DB is MS SQL Server 2005 one.

In the DB we have about dozen of relatively small tables with static data (read-only mode) – genders, languages, countries, etc. To optimize requests to the DB we’d like to cache those static tables in memory.

It’d be nice if LLBLGen product allows us configure caching some way so that we use generated entities “transparently”, I mean we needn’t to call some collection get-methods explicitly (like MS Cache Application Block). In other words, is it possible “mark” entity (in source code configuration file or LLBLGen project or somewhere else) so that once it read out from db it leaves in memory for an application lifecycle? We’d like to keep in memory all table records.

Could anyone give us some practical recommendations as to how to configure LLBLGen generation to enable the caching just described? May be some piece of code if configuration of the tool isn’t enough to implement caching.

We have started using LLBLGen recently, and haven’t wide experience, so could you please provide us with details and links for reference if any.

Cheers

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 29-Dec-2008 16:10:11   

That's not provided out of the box.

You should implement your own caching mechanism according to your business rules, taking into consideration when data should be refreshed for example.

So normally, when the application starts you'd load such data and store it in in-memory data structures (a hastable or a dictionary for fast access of your cached data).