1 Reply Latest reply on Nov 2, 2005 11:10 PM by kidder_whw

    about "detached entity" error

    kidder_whw

      The code following
      ....

      for(Check temp:checkTemp)
      em.remove(temp);
      em.merge(borrow);
      for(Check temp:checkList)
      em.persist(temp);
      ....


      One of check was Entity,Borrow is Entity,two Bean have not correlative the object ,CheckList is the object for Check's List,the program for em.merge(borrow)had OK forAll administer, but come to for "for em.persist(temp) " was lost


      the Exception following:

      org.hibernate.PersistentObjectException:
      detached entity passed to persist:govfms.ejb.project.C

      thanks!

        • 1. Re: about
          kidder_whw

          The code following
          ....

          for(Check temp:checkTemp)
          em.remove(temp);
          em.merge(borrow);
          for(Check temp:checkList)
          em.persist(temp);
          ....


          One of check was Entity,Borrow is Entity,two Bean have not correlative the object ,CheckList is the object for Check's List,the program for em.merge(borrow)had OK forAll administer, but come to for "for em.persist(temp) " was lost


          the Exception following:

          org.hibernate.PersistentObjectException:
          detached entity passed to persist:govfms.ejb.project.Check

          thanks!