Yup, an object in memory should only be tracked by *one* nhibernate session at any given time. I suspect that you're opening two sessions - one for managing orders and one for customers.
It's recommended to use one session per HTTP request on the web, or one per thread in windows apps. What's your test app running as - a console app? NUnit tests? Tobin On Jan 19, 8:44 pm, Kris-I <[email protected]> wrote: > Hello, > > I have 2 tables, Customer and Order. > > In the some test method, I do an Add, Get,Delete and Get on the Customer > table, that's was fine. > > Now I added a relation one-many between these table. > > When I execute the test, the one one fail now, I receive this message : > NHibernate.HibernateException: Illegal attempt to associate a collection > with two open sessions > > What is the rules, I must have one session by DB access ? I have to keep the > same session for all the DB access of my test ? > > Thanks, --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
