I'm implementing a custom session storage provider in ASP.Net. We have a strict 3-layer architecture and therefore the session storage needs to go through the business layer. Presentation->Business->Database. The business layer is accessed through WPF. The database is MSSQL.
What I need is (in order of preference):
- A commercial/free/open source product that开发者_JS百科 solves this.
- The source code of a SqlSessionStateStore (custom session store) (not the ODBC-sample on MSDN) that I can modify to use a middle layer.
I've tried looking at .Net source through Reflector, but the code is not usable.
Note: I understand how to do this. I am looking for working samples, preferably that has been proven to work fine under heavy load. The ODBC sample on MSDN doesn't use the (new?) stored procs that the build in SqlSessionStateStore uses - I'd like to use these if possible (decreases traffic).
Edit1: To answer Simons question on more info: ASP.Net Session()-object can be stored in either InProc, ASP.Net State Service or SQL-server. In a secure 3-layer model the presentation layer (web server) does not have direct/physical access to the database layer (SQL-server). And even without the physical limitations, from an architectural standpoint you may not want this. InProc and ASP.Net State Service does not support load balancing and doesn't have fault tolerance. Therefore the only option is to access SQL through webservice middle layer (business layer).
Since no good answer has been provided...
One solution is to not use SQL as storage, but instead use AppFabric.
http://msdn.microsoft.com/en-us/library/ee790859.aspx
Ref. Distributed ASP.Net State Service
精彩评论