I had this problem when you do something like: var customer = Session.Get<Customer>(id); customer.Orders.Add(order); Session.SaveOrUpdate(customer); customer.Orders = new List<Order>();
Its that last line that will cause you an issue. Use customer.Orders.Clear() with (code or configuration to handle the deletions) - if this turns out to be the issue. Post your code if not.. On Sep 22, 2:11 pm, prabs <[email protected]> wrote: > Hi, > We are planning to migrate on IIS7.5 and while testing the application > i have found a strange problem, when I update my object it throws me > this exception > "NHibernate.HibernateException: Illegal attempt to associate a > collection with two open sessions > at > NHibernate.Collection.AbstractPersistentCollection.SetCurrentSession(ISessi > onImplementor > session)" > > Everything works fine on IIS6.0. > > Thru some googling I have found that removing 'cascade=all' worked for > few persons, but this is not my case(I dont have this property set for > given object) > > Can you please help me to find the root cause and solution for the > same. > > FYI- I am using Nhibernate v2.0.50727, .Net Framework 4.0, SQL Server > 2005 > > Thanks > Prabhakar -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
