| 
					
						 I have an issue with a save on an object with multiple components giving a StaleObjectException and wondered if anyone else has come across it.
 
 Very simple class called Office which has three component classes; Address and two instances of TelephoneNumber called Telephone and Fax.
 
 My standard suite for the Dao class has three tests; Save, Update and Delete. The DAO is instantiated for each new test, but the Session is retained via a singleton; this may be generally not best-practice, but it's been working for over a year now so I don't think it's the underlying problem.
 
 Each test runs ok all by itself, but when run together either Save or Update fails, as its somehow retaining a reference to the Office object created by the previous test even though the test pattern looking like this..
 
             T entity = DefaultEntity();
             Dao.SaveEvict(entity);
             Dao.Flush();
 
 Now, what is very odd is that if I change the mapping so that there is only one component present, the tests all work correctly, so although there may be something incorrect with my code, I don't like the idea that just changing the mapping can cause an internal failure.
 
 I have about 10 projects with 100s of classes running successfully through this framework and this is the only instance where it's blowing up!
 
 Can't see anything unusual with the classes; the components override Equals and GetHasCode etc, etc, so I'm just wondering if anyone else has come across something similar.
 
 Can't post the code at the moment as it contains some client proprietary stuff and I don't have a simple test case as yet (next task!) 
											 _________________ Paul Hatcher
 NHibernate Team
					
  
						
					 |