views:

87

answers:

2

For my current project I'm using LINQ to SQL as ORM. For now I'm storing modified entities in session to save changes made between ASP.NET requests. What is the best practise for doing this, because lately I started seing this approach is not very scalable for the Web farms.

+2  A: 

I personally wouldn't do it at all. I know it's possible to re-attach the entities but that isn't trivial and I'm genuinely struggling to think of a benefit to doing this over other methods of maintaining state.

There's a nice article here which says there are pros and cons to various methods but I'd be interested to know what the pros are!

Neil Trodden
Thanks for the link - not the real answer, but new ideas to think about. Vote up!
Sergejus
A: 

Do you mean it isn't scaling for your web farm because you have InProc Session or because the more general process is not scaling? My opinion would be that if you have InProc Session and thus it won't work over a web farm, then you'll have to go out of process somewhere to save that data and so you might as well commit to the database. But, if you have a special circumstance you may want to explain it to get a better answer.

jarrett
You are right, it's because of InProc Session. As it's known, LINQ to SQL out of the box doesn't support deep (graph) serialization, but Session persistance requeres this.
Sergejus