M
Marc Vangrieken
Hi,
I read on msdn that "In general, a DataContext instance is designed to
last for one "unit of work" however your application defines that
term. A DataContext is lightweight and is not expensive to create. A
typical LINQ to SQL application creates DataContext instances at
method scope or as a member of short-lived classes that represent a
logical set of related database operations."
Is there any particular reason for this? What's the penalty (if there
is one) for making it long-lived? Will, for instance, the identity map
inside take to much memory?
Thanks, I'm just trying to understand...
I read on msdn that "In general, a DataContext instance is designed to
last for one "unit of work" however your application defines that
term. A DataContext is lightweight and is not expensive to create. A
typical LINQ to SQL application creates DataContext instances at
method scope or as a member of short-lived classes that represent a
logical set of related database operations."
Is there any particular reason for this? What's the penalty (if there
is one) for making it long-lived? Will, for instance, the identity map
inside take to much memory?
Thanks, I'm just trying to understand...