[jboss-user] [EJB 3.0] - Extended Persistence Context and merge()

smithbstl do-not-reply at jboss.com
Mon May 14 11:25:13 EDT 2007


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

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

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



More information about the jboss-user mailing list