2 Replies Latest reply on May 16, 2007 9:46 PM by wayne baylor

    Extended Persistence Context and merge()

    Brian Smith Apprentice

      This is kind of a general question but is there ever a need to merge an entity when using an Extended Persistence Context? I guess the overarching question is do entities ever become detached in an extended pc? Being new to EJB3/JPA I am having trouble conceptualizing when to use persist() vs using merge(). I know that persist is usually thought of as an sql INSERT and merge is usually thought of as an sql UPDATE but does merge() ever call an INSERT? Are merge() and persist() interchangeable when dealing with new entities (or are they ever interchangeable)?

      Thanks for any help.

      -Brian