diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code/NHibernateCustomerEditController.cs b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code/NHibernateCustomerEditController.cs index 3a21b65a..ea158d6b 100644 --- a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code/NHibernateCustomerEditController.cs +++ b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code/NHibernateCustomerEditController.cs @@ -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; } } }