As you sead merge is used for detached objects and persist for atached ones.
Short example for persist (update action)
Tab02000 recentRecord = (Tab02000)em.find(Tab02000.class, key);
.. do some changes to recentRecord
em.persist(recentRecord); // in this case JPA will call update action because you are changing existing object
Short example for merge
Tab02000 newRecord = new Tab02000();
... set all values
The second example is BAD PRACTISE of using JPA
merge() will figure out whether or not the entity passed is new or detached. If it's new then merge() will persist it (eventually resulting in an INSERT), otherwise it will update the DB with the current state of the entity (eventually resulting in an UPDATE).
(warning: merging a removed entity will throw an exception)
check these out for more info:
section 3.6 and 3.7
EJB3 Persistence Specification section 184.108.40.206