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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user