1

I am developing a web application with ASP.NET MVC 3 and Fluent NHibernate, in the future I will need to use more than one server because the user will double the amount of. How can I use this aproach, is it possible? How can I control the session between them?

1 Answer 1

2

Sure, it's possible. In order to be able to use the session you are going to need to move from InProc mode to SqlServer or StateServer.

Here's more detail about all the SessionState options you have: http://msdn.microsoft.com/en-us/library/ms178586.aspx

To use SqlServer follow the steps in this guide: http://support.microsoft.com/kb/317604

Also, bear in mind that objects that you put in the session must be marked as Serializable or else they won't be able to be stored in the database or State server.

Sign up to request clarification or add additional context in comments.

4 Comments

Plablo, thanks! Is it possible to manage multiple databases too?
You're welcome :). You mean one database per server? That's probably not what you'd want. Usually the database server is shared among all web-servers in the farm to feed off the same data. Both for sessions and the back-end database as well. You usually scale horizontally by adding more web servers behind a load balancer to be able to process more incoming requests, but your database server will need to be able to handle the load from all of them. You could however have Sql Server clusters and fail-over servers, but that is actually not my area of expertise :).
Sure, no problem. If the answer was what you were looking for feel free to mark it as accepted ;)
@MichelAndrade I just reread your question, and noticed that you might have been asking about the NHibernate Session, and not the ASP.NET Session. For NHibernate each web server would have it's own session, most likely using one of the common usage patterns, such as session-per-request or one of those.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.