Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Prefetch from a cache
 

Pages: 1
LLBLGen Pro Runtime Framework
Prefetch from a cache
Page:1/1 

  Print all messages in this thread  
Poster Message
Ian
User



Location:
Hertfordshire, UK
Joined on:
01-Apr-2005 16:37:36
Posted:
511 posts
# Posted on: 27-Jun-2012 20:14:59.  
When I'm loading items from a shopping cart, lots of stuff gets prefetched around those items but the prefetched stuff rarely changes - its static stuff like products and payment methods. Is there some way of prefetching this stuff from an in memory cache instead of going to the database for all these items? I could do it manually but then I would have to write the code to build up the object graph instead of having LLBLGen do it.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14585 posts
# Posted on: 27-Jun-2012 20:34:56.  
You can pre-load them and cache them in memory, instead of prefetching them each time.

  Top
Ian
User



Location:
Hertfordshire, UK
Joined on:
01-Apr-2005 16:37:36
Posted:
511 posts
# Posted on: 27-Jun-2012 22:03:26.  
OK but do I need to look them up in the cache and build up the object graph manually?

So, for example, an order detail references a product. If I use a prefetch when fetching the order detail then the order detail instance will already be referencing the product. But if I store the product in memory then I will I need to assign it to the order detail's product property?
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37870 posts
# Posted on: 28-Jun-2012 11:41:50.  
Add all entities to a context, and use the context with the fetch, so you won't get duplicate instances.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Ian
User



Location:
Hertfordshire, UK
Joined on:
01-Apr-2005 16:37:36
Posted:
511 posts
# Posted on: 06-Jul-2012 03:42:50.  
Sounds cool.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.