title: ASP .NET,concurrency control with WCF
body: <p>I would like to take advise from all of you based on your experience with SOA based architecture and how to achieve concurrency control with WCF and nHibernate.</p>
  
  <ol>
  <li>ASP .NET (web app) - 1 tier (Web server)</li>
  <li>WCF+nHibernate - 2nd tier (Application server)</li>
  </ol>
  
  <h2>Scenario1</h2>
  
  <p>a. User1 has now opened an Order and Edits it.
  b. User2 in meantime opens the same Order and Edits it.</p>
  
  <p>How do we prevent User2 from performing this operation. Both WCF calls to "edit order" fetches the record using different nHibernate sessions as the application server is designed to be stateless.</p>
  
  <p>How do I configure nHibernate/WCF to handle this kind of scenario? </p>
  
  <h2>Scenario2</h2>
  
  <p>If entering an order involves multiple pages; with pages getting displayed based on business logic (WCF calls to determine next page) should the order data be maintained at Web Server (ASP .NET) across these pages and posted on each WCF call taking care of the order business logic? Is my thinking right?</p>
  
  <p>I'm aware of the other way to do it, which is to create a temporary order record to maintain intermediate data across pages/WCF calls.</p>