views:

137

answers:

2

Hi

The major subject in .net programs is "How manage memory for best performance". so Microsoft use garbage collector in .net and with that, we don't need to do something for managing memory(or better say we can use GC easily)

But when you develop big project(business app), you make too many tables and database for your own project. so if you use Linq-to-sql, we must build DataContext include hundred or more tables. That make problem for program when you create an object from datacontext, that object give big amount of memory. also we cant divide datacontext to datacontexts(cuz relation between tables)

so "How manage datacontext and memory"?

A: 

As Midhat already commented, big databases with hundreds of tables and huge amounts of data should not be any problem for LINQ to SQL or any O/RM tool what so ever. Perhaps you're doing something wrong. If you're having problems, try posting some code here so we can take a look. Perhaps the problem is that you're caching a single DataContext. Yes, this will go wrong. I just answered a similar question here at SO, that might interest you. Read it while it's hot.

Steven
I read your "hot answer" :) .But for testing those solutions I need time. after that i send post result here. Thanks for help(Mean Hot help)
Rev
A: 

See this for example - "Linq to SQL DataContext Lifetime Management": http://www.west-wind.com/weblog/posts/246222.aspx This approach makes life simpler.

sinm
I see your article before I post my questionI will read that again.
Rev