0 Replies Latest reply on Mar 19, 2008 10:45 AM by matias.blasi

    Tomcat 5 + Hibernate 3 + Hivetrans = duplicated key...

    matias.blasi

      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!