The Patterns of Enterprise Application 
 refer to this has an Identity Map.  It means that if you go

Var a = Airplane.Load(1)
Var b = Airplane.Load(1)

Then a will equal b sine the Idenity map will recognise that you have already 
loaded Airplane number 1 and loading it again will simply pull it from memory.

If they are loaded from the DB twice and are in different parts of memory then 
a will not equal b.   From high level programming perspective this is a bad 
place to find yourself in.   (I don’t know if the EF has an identity map.)

To pull of an identity map you will need to bind it to a transaction scope and 
a basic caching algorithm.

Dave A

From: [] On 
Behalf Of Craig van Nieuwkerk
Sent: Monday, 19 September 2016 11:44 AM
To: ozDotNet <>
Subject: Re: Entity Framework - the lay of the land

Correct, in a web app for example, you can often do very short lived caching 
for the life of a request.

On Mon, Sep 19, 2016 at 11:39 AM, Tony Wright 
<<>> wrote:
I do like caching. And you often don't need to cache for very long anyway to 
get significant benefits.

Reply via email to