Added comment to clarify the reasoning behind the call to Session.Lock(...) in the sample app to ensure that future misunderstandings as lead to this forum post don't reoccur: http://forum.springframework.net/showthread.php?t=7261

This commit is contained in:
sbohlen
2010-09-30 18:03:29 +00:00
parent 227022824e
commit ce22e68a9d

View File

@@ -35,8 +35,12 @@ public class NHibernateCustomerEditController : ICustomerEditController
get
{
Customer customer = currentCustomer;
//since the Customer entity may have been retrieved from a prior request, we need to reattach it to the current session
// in order to support lazy-loading, etc. on the Customer
Session.Lock(customer, LockMode.None);
return customer;
return customer;
}
}
}