I have a duplicate key exception when hibernate updates a list wich have been modificated.
I have a test which reproduce it sistematically, it has 2 clasess, one mapped @oneToMany to the other. The first has a list of the second. In a transaction scope I remove one element of the list, and later I add it again, hibernate try to insert again all elements without remove them, then i have a "duplicated unique key exception" at the commit.
I am geting the session through the hivetrans.hibernate3.SessionFactory
I could make it run successfully geting the session programaticaly, begining and commiting the transaction manually:
cfg = AnnotationConfiguration("cfg.xml); sf = cfg.buildSessionFactory(); s = sf.openSession();