1 Reply Latest reply on Jan 14, 2009 7:49 AM by jaikiran

    Detached Entity passed to persist

    mravikrish

      Hi All,

      I am using jsf and ejb3 for my project. i am getting the following exception Detached Entiy passed to persist while persisting project object.

      i am creating this project object and passsing as parameter to ejb session bean method. for the first time it is working fine. but second time it is throwing the above exception. can any body help me.
      Thanks
      K Ramu

        • 1. Re: Detached Entity passed to persist
          jaikiran

          When you return the entity back to the client from the bean, it becomes detached from the entitymanager. When you are passing the entity back to the bean, the second time, you have the option to call the

          mergedEntity = entityManager.merge(entity);


          to re-attach the detached entity.