[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Tomcat 5 + Hibernate 3 + Hivetrans = duplicated key...

matias.blasi do-not-reply at jboss.com
Wed Mar 19 10:45:42 EDT 2008


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();
  | 

Why could the hivetrans session factory make change the strategy of persist the dirty list?

Thank in advance for yout help!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137789#4137789

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137789



More information about the jboss-user mailing list